Flutter build failed 'UserAgent.h' file not found

三世轮回 提交于 2020-05-11 04:49:28

问题


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:

  • flutter pub cache repair
  • flutter clean
  • deleting Podfile.lock and ios/pod install

But no luck.

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

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


回答1:


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.




回答2:


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.




回答3:


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"


来源:https://stackoverflow.com/questions/59592295/flutter-build-failed-useragent-h-file-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!