Flutter build failed 'UserAgent.h' file not found

3,774

Solution 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.

Solution 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.

Share:
3,774
Blasanka
Author by

Blasanka

Watch Jon Skeet talk in Stack Overflow HQ. See top SO users Yes this is 2018, Miss you Java, busy with Dart. Java: List<String> carriers = Arrays.asList("web", "software", "mobile"); System.out.print(carriers.stream() .map(String::toUpperCase) .collect(joining(", ")) .concat(" developer")); Dart: List<String> carriers = ['web', 'mobile', 'desktop']; print('''${carriers.join(', ') .toUpperCase()} developer'''); See, who I respect on this amazing world.

Updated on December 16, 2022

Comments

  • Blasanka
    Blasanka over 1 year

    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?