Flutter build failed 'UserAgent.h' file not found

后端 未结 4 802
名媛妹妹
名媛妹妹 2021-02-14 02:30

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 hot

相关标签:
4条回答
  • 2021-02-14 02:49

    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"
    
    0 讨论(0)
  • 2021-02-14 02:55

    Here are two solutions that try to solve this

    1. If anyone kept the ^ in the version like this firebase_core: ^0.4.4+2, remove it otherwise it will keep using newer versions.

      To solve this, Pubspec.yaml removed ^ from all firebase plugins and flutter clean.

      firebase_auth: 0.15.4
      cloud_firestore: 0.13.4
      firebase_core: 0.4.4
      
    2. If you tried the first solution but you getting a still error then there is something problem with .pub-cache

      To solve this, run the commands below.

      1. cd ios
      2. pod deintegrate
      3. cd ..
      4. flutter channel stable
      5. flutter upgrade
      6. flutter clean
      7. flutter build ios
    0 讨论(0)
  • 2021-02-14 03:00

    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.

    0 讨论(0)
  • 2021-02-14 03:01

    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.

    0 讨论(0)
提交回复
热议问题