1

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 <…>
Ketan Odedra
  • 1,215
  • 10
  • 35
Hasen
  • 11,710
  • 23
  • 77
  • 135

2 Answers2

1

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.

Angel Todorov
  • 1,443
  • 2
  • 19
  • 37
0

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

Kaboom
  • 558
  • 4
  • 14
  • The installation instruction don't mention that though? There's no mention of `GoogleService-Info.plist` anywhere: https://pub.dev/packages/firebase_admob – Hasen Jul 16 '19 at 08:07
  • It's suposed to follow this installation guide before add any plugin. Just add the file and all will be fine. I added the file inside the folder ./ios and ./ios/runner – Kaboom Jul 16 '19 at 08:10
  • I've added lots of other packages by just following the instructions. I never needed anything else. So I need to create a firebase project?? Are you sure? Can't believe they wouldn't mention that in the installation instructions...? – Hasen Jul 16 '19 at 08:35
  • Ok, my guess was that you used firebase_admob since you were using a firebase project. If u want to use admob without firebase use another plugin like:https://pub.dev/packages/flutter_admob#-readme-tab- – Kaboom Jul 16 '19 at 08:41
  • No it's just the most popular admob package for flutter. If you search for implementing Admob with Flutter they almost always use firebase_admob...regardless of whether you are using firebase already or not. I tried using the other admob package you suggest `flutter_admob` but it makes my app huge....check here: https://stackoverflow.com/questions/57032727/flutter-huge-app-size-in-ios-compared-with-react-native-original – Hasen Jul 16 '19 at 08:44
  • So if you want to use firebase_admob just create a new firebase project and add the GoogleService-Info.plist into your project. – Kaboom Jul 16 '19 at 08:59