Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flutter Ios build fails after upgrading firebase core

I had a flutter app which was working fine with firebase core (version 0.4.0). I upgraded the firebase_core to version 0.5.0 and did all changes as per the migration. After that ios build is giving following error

Launching lib/main.dart on iPhone SE (2nd generation) in debug mode...
 
Running Xcode build...                                                  
                                                   
Xcode build done.                                           95.9s
Failed to build iOS app
Error output from Xcode build:
↳
    AssertMacros: amdErr = AMDeviceConnect(tmpDevice) == 0 ,  file:
    /BuildRoot/Library/Caches/com.apple.xbs/Sources/MobileDevice/MobileDevice-1190.100.2.1/Source/AMDevicePowerAssertion.c, line: 224, value: -402653083
    ** BUILD FAILED **


Xcode's output:
↳
    <module-includes>:1:1: error: umbrella header for module 'GoogleUtilities' does not include header 'GULLoggerCodes.h' [-Werror,-Wincomplete-umbrella]
    #import "Headers/GoogleUtilities-umbrella.h"
    ^
    1 error generated.
    In file included from /Users/yogesh/projects/mobile-flutter/ios/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnostics.m:24:
    /Users/yogesh/projects/mobile-flutter/ios/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Logger/Private/GULLogger.h:22:9: fatal error: could not build module
    'GoogleUtilities'
    #import <GoogleUtilities/GULLoggerLevel.h>
     ~~~~~~~^
    2 errors generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

It is running fine in android and even building ios build from xcode also works fine. Its build and run from command line which fails (flutter run)

Following is my pubspec file containing firebase dependency

dependencies:
  flutter:
    sdk: flutter
  firebase_core: ^0.5.0
  firebase_auth: ^0.18.0+1
  cloud_firestore: ^0.14.0+2
  sqflite:
  path:
  progress_dialog: ^1.2.4

i am not able to understand is it because of library error or something from my side because it seems lib error but android and ios build from xcode works totally fine.

like image 439
Yogesh Avatar asked Aug 25 '20 14:08

Yogesh


3 Answers

Run command

flutter clean

And then re-run the application works for me.

like image 179
Đạo Phạm Avatar answered Nov 15 '22 06:11

Đạo Phạm


I have just had the same issue as in I was able to run the app from XCode Runner but not from within Android Studio with the same exact error message. I managed to fix the issue via these steps:

  1. Adding firebase_analytics: ^6.0.0 to pubspec.yaml.
  2. Then removing Podfile and Podfile.lock.
  3. And finally running it again.

However I cannot tell you why exactly it resolved the issue so cannot really guarantee this will work out for you.

like image 33
Ivan Rybalko Avatar answered Nov 15 '22 07:11

Ivan Rybalko


delete Podfile and Podfile.lock and run it, it will work

like image 39
Rashid Iqbal Avatar answered Nov 15 '22 08:11

Rashid Iqbal