0

Trying to add firebase_admob in Flutter project.

First of all I created Firebase project and then 2 apps in that project (Android and iOS).

Executed all steps (including google-services.json/GoogleService-Info.plist and appropriate source code)

In pubspec.yaml just have these dependencies:

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^0.1.3
  firebase_admob: ^0.10.0+2

Then used this module to add admob functionality: https://pub.dev/packages/firebase_admob/install

When I run this project on Android everything is fine. Test ad banner is shown.

Then trying to run the same repository on mac (command: flutter run). And receive following error:

admin@Mac-Admin firebase_admob_test % flutter run
Running "flutter pub get" in firebase_admob_test...                 2.4s
Launching lib/main.dart on iPhone 8 in debug mode...
 
Running pod install...                                              6.1s
flutter: BannerAd event is MobileAdEvent.loaded                         
Running Xcode build...                                                  
 └─Compiling, linking and signing...                         4.9s
Xcode build done.                                           57.8s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    /Users/admin/Projects/firebase_admob_test/ios/Runner/GeneratedPluginRegistra
    nt.m:10:9: fatal error: module 'firebase_admob' not found
    @import firebase_admob;
     ~~~~~~~^~~~~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 8.0, but the range of supported deployment target versions is 9.0 to
    14.0.99. (in target 'nanopb' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 8.0, but the range of supported deployment target versions is 9.0 to
    14.0.99. (in target 'GoogleUtilities' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 8.0, but the range of supported deployment target versions is 9.0 to
    14.0.99. (in target 'PromisesObjC' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 8.0, but the range of supported deployment target versions is 9.0 to
    14.0.99. (in target 'GoogleDataTransport' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 8.0, but the range of supported deployment target versions is 9.0 to
    14.0.99. (in target 'Runner' from project 'Runner')
    warning: Capabilities for Signing & Capabilities may not function correctly
    because its entitlements use a placeholder team ID. To resolve this, select
    a development team in the Runner editor. (in target 'Runner' from project
    'Runner')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 8.0, but the range of supported deployment target versions is 9.0 to
    14.0.99. (in target 'Pods-Runner' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 8.0, but the range of supported deployment target versions is 9.0 to
    14.0.99. (in target 'FirebaseInstallations' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 8.0, but the range of supported deployment target versions is 9.0 to
    14.0.99. (in target 'FirebaseCoreDiagnostics' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 8.0, but the range of supported deployment target versions is 9.0 to
    14.0.99. (in target 'FirebaseCore' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 8.0, but the range of supported deployment target versions is 9.0 to
    14.0.99. (in target 'GoogleAppMeasurement' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 8.0, but the range of supported deployment target versions is 9.0 to
    14.0.99. (in target 'FirebaseAnalytics' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 8.0, but the range of supported deployment target versions is 9.0 to
    14.0.99. (in target 'Firebase' from project 'Pods')

Could not build the application for the simulator. Error launching application on iPhone 8.

Source code may be found here https://github.com/vetalitet/firebase_admob_test

Before asking here I tried to find a solution, but nothing helped. This module is still not visible. And because I'm new in iOS development, I don't know how to continue investigate this issue. Maybe you may advice some way to go.

vetalitet
  • 703
  • 2
  • 10
  • 25

0 Answers0