I have problem with archiving my project in Xcode, it fails and throws an error: Module 'firebase_admob' not found
Build project: $flutter build ios
Select Product > Archive
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]
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.
Related
When upgrade flutter has an exception and the application can't run again how can I solve it?
In file included from
/Users/raitotec/developer/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.12+4/ios/Classes/FLTSharedPreferencesPlugin.m:5:
/Users/raitotec/developer/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.12+4/ios/Classes/FLTSharedPreferencesPlugin.h:5:9
: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
flutter doctor -v
[✓] Flutter (Channel stable, 1.22.5, on Mac OS X 10.15.7 19H524 darwin-x64, locale en-SA)
• Flutter version 1.22.5 at /Users/raitotec/developer/flutter
• Framework revision 7891006299 (9 months ago), 2020-12-10 11:54:40 -0800
• Engine revision ae90085a84
• Dart version 2.10.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/raitotec/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.0
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 50.0.1
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] Connected device (1 available)
• iPhone 12 mini (mobile) • A9648508-3B05-4468-B593-477288FC7370 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
try flutter clean then flutter pub upgrade
Had a similar issue.
After pub upgrade, (long story short) the app was not working as before.
The file pubspec.yaml contains the dependencies(packages) used by the app, usually the min version of the added packages.
The file pubspec.lock, contains all the dependencies(packages) of the app, with the exact version of each dependency.
When you run pub upgrade it fetches the newest versions of all the dependencies and updates the pubspec.lock,
so for example, a dependency in pubspec.yaml may states version 1.0, after the pub upgrade the used version can be 1.1(in the pubspec.lock)
Although this file should not included in the commits, if you have access to the previous version of it, you can compare it with the one after the pub upgrade` and revert it where needed.
Downgrading a dependency solved the problem for me.
I am receiving this message with a rejection when I submit my app for review on the App Store:
"Specifically, your app displayed a white, blank screen when we launched your app."
When I test the app on device, everything appears to be working fine. I have tried the following to test:
flutter build ios
flutter run
flutter build ios --release
flutter run
Test with VSCode's run feature.
Run in xcode onto physical device both in Debug and Release schema settings
If I archive, and upload the same build to Testflight, the app can be installed and ran without issue on several different devices.
While all of these methods work on my physical iphone, when I run
flutter build ios --release
open xcode
archive
upload with Organizer in xcode
The app is rejected by Apple. I searched around and found nothing that solves my issues. Any suggestions or good next steps?
flutter doctor:
[✓] Flutter (Channel stable, 1.22.6, on macOS 11.1 20C69 darwin-x64, locale en-US)
• Flutter version 1.22.6 at /Users/matthewkrager/flutter
• Framework revision 9b2d32b605 (5 days 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 30.0.3)
• Android SDK at /Users/matthewkrager/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
✗ Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.9.1
[!] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.52.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.18.1
[✓] Connected device (2 available)
Cocoapods seems to install a wrong pod version.
Here is an example line from my pubspec.yaml:
webview_flutter: ^1.0.7
When running pod install, this is what I see:
Installing webview_flutter (0.0.1)
In my flutter/.pub_cache/hosted/pub.dartlang.org/ I see the only the following versions:
webview_flutter-0.3.24
webview_flutter-1.0.7
When building with XCode, I get a few warnings from webview_flutter that point to the correct 1.0.7 version, so it seems the right pod is being used despite the cocoapods output. However, this is really confusing. Any thoughts how to solve this would be greatly appreciated.
I have tried re-installing cocoapods, deintegrating pods and building again, cleaning, updating pod repo, deleted Podfile.lock etc usual suspects.
Here's my environment:
[✓] Flutter (Channel stable, 1.22.5, on Mac OS X 10.15.7 19H15 darwin-x64, locale en-FI)
• Flutter version 1.22.5 at /Users/ilonamooney/Documents/dev/flutter
• Framework revision 7891006299 (10 days ago), 2020-12-10 11:54:40 -0800
• Engine revision ae90085a84
• Dart version 2.10.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/ilonamooney/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = /Users/ilonamooney/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• 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.0
[!] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] Connected device (1 available)
• Ilona’s iPhone (mobile) • a12e6e165529c7307dfdb723f37e02f3901f17d0 • ios • iOS 14.2```
Steps to Reproduce
Simply trying to publish my app to ios store. Already available on Play store.
I cannot archive in Xcode, constantly running into issues. Currently have these issues when attempting to archive:
When attempting to run pod install in the ios directory, I continue to get this warning (which according to my research seems to be more of an error):
I tried following everything in this very long thread thread to resolve this issue, but nothing has worked.
I was able to remove another warning by uncommenting line #2 in the Podfile, platform :ios, '9.0'.
I have tried closing Xcode while making changes, and have tried restarting my computer.
I can flutter run and the app will work correctly on my iPhone when it is connected to my macbook.
Other threads from which I've tried everything:
https://github.com/flutter/flutter/issues/42974
https://github.com/flutter/flutter/issues/20685
https://github.com/flutter/flutter/issues/48103
https://github.com/X-Wei/flutter_catalog/issues/26
https://github.com/flutter/flutter/issues/28870
Expected results:
I can successfully archive in Xcode.
Actual results:
Flutter doctor seems to indicate everything is fine, but I continue to get this errors when trying to archive.
AdministorsMBP4:mem_plus_plus matt$ flutter doctor --verbose
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.3 19D76, locale en-US)
• Flutter version 1.12.13+hotfix.5 at /Users/matt/development/flutter
• Framework revision 27321ebbad (9 weeks ago), 2019-12-10 18:15:01 -0800
• Engine revision 2994f7e1e6
• Dart version 2.7.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
• Android SDK at /Users/matt/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• 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 11.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.1, Build version 11A1027
• CocoaPods version 1.8.4
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 37.1.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[!] IntelliJ IDEA Community Edition (version 2019.2.4)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins
[✓] Connected device (1 available)
• Takkeezi’s iPhone • {redacted} • ios • iOS 12.4.4
Try to this.
flutter clean
pod install
build project
Check a pods module
Pod file
I'm using Flutter with Android-Studio, everything was working great (i.e. compiling and deploying to iOS simulators except until I installed Fastlane Tools. The building process now is broken somehow! I'm not sure if it's from Fastlane or something else though, but now I'm stuck and cannot deploy to iOS anymore.
Steps taken/tried already:
Removing XCode & CommandLineTools (using this post: Complete removal old XCode)
Reinstalling XCode 9.2 (from AppStore)
Reinstalling CommandLineTools for XCode 9.2 (dl from developer tools page)
Reinstalling/updating ios-deply using:
npm install -g ios-deploy --unsafe-perm=true
Error log is on PasteBin to reduce post size:
https://pastebin.com/HQdJYLBr
Flutter doctor report:
[✓] Flutter (on Mac OS X 10.13.3 17D102, locale en-AE, channel alpha)
• Flutter version 0.0.22-pre.1 at /Users/user999/github/flutter
• Framework revision 553fc4264e (3 weeks ago), 2018-03-01 09:30:25 -0800
• Engine revision 6921873c71
• Tools Dart version 2.0.0-dev.16.0
• Engine Dart version 2.0.0-edge.da1f52592ef73fe3afa485385cb995b9aec0181a
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/user999/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• 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-915-b08)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.2, Build version 9C40b
• ios-deploy 1.9.2
• CocoaPods version 1.4.0
[✓] Android Studio (version 3.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
[✓] IntelliJ IDEA Community Edition (version 2017.3.4)
• Flutter plugin version 21.2.3
• Dart plugin version 173.4548.30
[✓] Connected devices
• iPhone X • 2AD97E20-6FB5-4086-BDC0-EBE6138FBD79 • ios • iOS 11.2 (simulator)
Any suggestions, please?
This answer is for the ones who are still trying to work with Xcode 9.2. Starting April, 2020, all apps submitted to the App Store will need to be built with Xcode 11. So don't try to build your Flutter IOS App with XCode 9.2.
Flutter is also changing rapidly therefore, it is better to use the latest XCode version to avoid any deprecated API issue.
For reference visit:
https://github.com/firebase/firebase-ios-sdk/issues/4125