0

I have problem with archiving my project in Xcode, it fails and throws an error: Module 'firebase_admob' not found

  1. Build project: $flutter build ios
  2. Select Product > Archive

enter image description here

Also I had to rollback Google-Mobile-Ads-SDK version from the newest 8.0.0 to 7.69.0 to make $flutter build ios work as described here

I've already cleaned and updated pods:

$flutter clean
$rm ios/podfile.lock
$rm ios/podfile
$pod update
$flutter pub get

I set target version to 12.0 in Podfile and Xcode settings.

For now I can build my project with $flutter build ios command but I can't archive it in Xcode for further distribution.

Flutter doctor

[✓] Flutter (Channel stable, 1.22.6, on Mac OS X 10.15.7 19H2 darwin-x64, locale ru-RU)
    • Flutter version 1.22.6 at /Users/bob/Documents/Projects/Flutter/flutter
    • Framework revision 9b2d32b605 (3 weeks ago), 2021-01-22 14:36:39 -0800
    • Engine revision 2f0af37152
    • Dart version 2.10.5

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
    • Android SDK at /Users/bob/Library/Android/sdk
    • Platform android-29, build-tools 29.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.3, Build version 12C33
    • CocoaPods version 1.10.1

[✓] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin installed
    • Dart plugin version 201.9245
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[✓] VS Code (version 1.53.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.19.0

[!] Connected device
    ! No devices available

! Doctor found issues in 1 category.
Dart SDK 2.10.5
Flutter SDK 1.22.6
app 1.0.0+1

dependencies:
- cupertino_icons 1.0.0
- firebase_admob 0.11.0+1 [meta flutter firebase_core]
- firebase_core 0.7.0 [firebase_core_platform_interface flutter quiver meta firebase_core_web]
mr.boris
  • 3,667
  • 8
  • 37
  • 70

1 Answers1

0

One way to get around this is to build ipa file. You have to change Flutter's channel to the beta or master and upgrade to the latest version:

$flutter channel beta
$flutter upgrade

Then you should use the new feature of build tool: $flutter build ipa

It generates archive in your project folder: <app_name>/build/ios/archive/<provisioning_profile_name>.xcarchive

So, you can open generated archive (i.e. My Test App.xcarchive) with Xcode and then validate it and upload to AppStore Connect as usual.

mr.boris
  • 3,667
  • 8
  • 37
  • 70