Blasanka
Blasanka

Reputation: 22447

Flutter build failed 'UserAgent.h' file not found

Project cannot build or debug with firebase_crashlytics. In my mac I've updated to Flutter latest but the machine we are deploying the app have lower version (Flutter 1.9.1 hotfix-5). So I tried below things:

But no luck.

#import "UserAgent.h"
        ^~~~~~~~~~~~~
1 error generated.

Is there any solution without upgrading flutter for the time being?

Upvotes: 10

Views: 4062

Answers (3)

Blasanka
Blasanka

Reputation: 22447

I was almost there, I think even if I clean the flutter and pod install will not clear everything. I just had to do below steps:

  • flutter clean
  • Delete Podfile.lock
  • cd ios
  • pod deintegrate // or you can do **cd ios/pod deintegrate** without above step
  • pod install

If this still didnt work. Please close .xcworkspace and podfile.lock then do last two step again and open newly generated .xcworkspace and Product -> build.

If not yet fixed please add a comment below (I have dealt lot of these problems).

Check here are created issues for this: issue 1 with firestore and issue 2 with crashlytics.

Upvotes: 23

Pedro kautza
Pedro kautza

Reputation: 1

I found the solution

just comment or import and put this code below it should look like this

#import "FLTFirebaseCorePlugin.h"
// #import "UserAgent.h"
// Generated file, do not edit

#define LIBRARY_VERSION @"0.4.4-2"
#define LIBRARY_NAME @"flutter-fire-core"

Upvotes: -2

Shubham Chaudhary
Shubham Chaudhary

Reputation: 51123

As mentioned in the firestore issue ticket, fixing the version of the firebase core to 0.4.4 instead of using 0.4.4+2 fixed the issue:

dependency_overrides:
  firebase_core: 0.4.4

Add this along with your existing firebase_auth dependency.

Upvotes: 3

Related Questions