Hasen
Hasen

Reputation: 12304

Flutter firebase_admob not working on iOS with default app install

Steps to reproduce:

  1. create a default app in Android Studio
  2. build and run the app successfully in iOS simulator through Android Studio
  3. add dependency firebase_admob: ^0.9.0+2 in pubspec.yaml
  4. app builds successfully but crashes on startup
  5. follow instructions to add GADApplicationIdentifier with test ID code into ios/Runner/info.plist file

The app still crashes on startup. Instructions were followed for setting up on iOS as detailed here: https://pub.dev/packages/firebase_admob.

As far as I can see, I've done everything as instructed so no idea why it doesn't work with a default app.

The error I get after all steps above is:

Xcode build done. 8.5s
Configuring the default Firebase app...
6.4.0 - [Firebase/Core][I-COR000004] App with name __FIRAPP_DEFAULT does not exist.
6.4.0 - [Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.
6.4.0 - [Firebase/Core][I-COR000005] No app has been configured yet.
6.4.0 - [Firebase/Core][I-COR000005] No app has been configured yet.

*** First throw call stack: ( 0 CoreFoundation 0x0000000113b521bb
__exceptionPreprocess + 331 1 libobjc.A.dylib 0x00000001130f0735
objc_exception_throw + 48 2 CoreFoundation 0x0000000113b52015 +
[NSException raise:format:] + 197 3 Runner 0x000000010bd33af0 +[FIRApp
configure] + 576 4 Runner 0x000000010bd7f1c5 -[FLTFirebaseAdMobPlugin
init] + 261 5 Runner 0x000000010bd7ef2e +[FLTFirebaseAdMobPlugin
registerWithRegistrar:] + 78 6 Runner 0x000000010bd333fb +
[GeneratedPluginRegistrant registerWithRegistry:] + 123 7 Runner <…>

Upvotes: 1

Views: 1966

Answers (2)

Angel Todorov
Angel Todorov

Reputation: 1533

I believe this medium post is the most comprehensive ios Firebase setup guide, however point 1 can be skipped - I have an app using firebase_admob 0.8.0+3 and it works flawlessly under iOS, once all other steps are completed.

Upvotes: 1

Kaboom
Kaboom

Reputation: 568

You need to add GoogleService-Info.plist from firebase to your project.

Check this links:

https://support.google.com/firebase/answer/7015592

https://firebase.google.com/docs/ios/setup

Upvotes: 0

Related Questions