0

My app working correctly on Android but I have exception on iOS.

The iOS build was done on Codemagic.

Dev. environment - Windows Flutter Dart.

What is missing?

The exception on the following line in mainCommon

FirebaseApp firebaseApp = await Firebase.initializeApp();

mainCommon -

Future<void> mainCommon() async  {
  try {
    loggerDBND("START - MainComminStart0");
    FirebaseApp firebaseApp = await Firebase.initializeApp();

    loggerDBND("START - MainComminStart1");
    FirebaseMessaging.onBackgroundMessage(_messageHandler0);

    loggerDBND("START - MainComminStart2");
    globals.messaging = await FirebaseMessaging.instance;

    loggerDBND("START - MainComminStart3");
    globals.messaging.requestPermission();

    loggerDBND("START - MainComminStart4");
    await globals.messaging.subscribeToTopic("messaging");

    loggerDBND("START - MainComminStart5");
    globals.messaging.getToken().then((value) {
      print("Token -" + value.toString() + "-");
    });

    loggerDBND("START - MainComminStart6");


  } on Exception catch (exception) {
    loggerDBN("mainCommon - exception"+exception.toString() );
  } catch (error) {
    loggerDBN("mainCommon - error" + error.toString());
  }

The exception -

main- error[core/not-initialized] Firebase has not been correctly initialized. Have you added the "GoogleService-Info.plist" file to the project? 
    
View the iOS Installation documentation for more information: https://firebase.flutter.dev/docs/installation/ios

File "GoogleService-Info.plist" location - ....\ios\Runner

Kobi
  • 127
  • 1
  • 11

1 Answers1

2

In a similar issue from the past, adding GoogleService-Info.plist to the correct folder by dragging and dropping the file using Apple's Xcode was the solution.

Another user provided a windows workaround

van
  • 550
  • 4
  • 15
  • But I don't have Xcode. Codemagic build the .ipa. I moved the file using Windows Move – Kobi Jun 20 '21 at 21:04
  • I understand. I added a link to another answer that shows a workaround for windows that might help – van Jun 20 '21 at 22:10
  • I open the project.pbxproj file and didn't find GoogleService-Info.plist Is it mean, the plist will not be in the build? – Kobi Jun 20 '21 at 22:41
  • I updated the files and waiting for the build to finish – Kobi Jun 20 '21 at 23:03