Flutter app on Xcode won't launch after upgrade - xcode

I have an app made in Flutter and since the latest version of Xcode absolutely nothing works as before.
I have been struggling with this problem for nearly a week now and the errors vary depending on the hour.
The main problem is that when distributing the application to Apple for review, they reject it with the following message:
2.1 Performance: App Completeness Guideline
2.1 - Performance - App Completeness
We discovered one or more bugs in your app when reviewed on iPad
running iOS 14.0 on Wi-Fi.
Specifically, we were still unable to login through Sign in with Apple
I find this strange as all my previous uploads got verified without any problems.
So to rectify this issue I'm trying to run the app through the simulator as I don't own an iPad.
And here is where the problems start.
Side note: Running on a physical iPhone works without problems and I'm opening the project runner.xcworkspace, not the runner.xccodeproj.
The main problem is that Xcode won't find any libraries, starting with the first one:
GeneratedPluginRegistrant.m:10:9: Module 'apple_sign_in' not found
I have tried every solution related to this issue but to no avail.
Remove the pod files, pod install,
pod deintegrate, pod init, pod install
flutter build ios --release, flutter run
Ive tried removing my project and cloning it for a fresh start
Sometimes not even a boilerplate app will work
I have checked github posts like https://github.com/flutter/flutter/issues/53573 and https://github.com/flutter/flutter/issues/33423 with no luck.
...checked countless threads.
Flutter doctor and pod-file below:
[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.6 19G2021,
locale en-ES)
• Flutter version 1.20.4 at /Users/peter/flutter
• Framework revision fba99f6cf9 (11 days ago), 2020-09-14 15:32:52 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK
version 30.0.1)
• Android SDK at /Users/peter/Library/Android/sdk
• Platform android-30, build-tools 30.0.1
• Java binary at:
/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/bin/java
• Java version Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.0, Build version 12A7209
• CocoaPods version 1.9.3
[!] Android Studio (not installed)
• Android Studio not found; download from
https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup
for detailed instructions).
[!] IntelliJ IDEA Community Edition (version 2017.2.5)
• 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)
• iPhone 11 (mobile) • F1B8AE15-9028-4E0D-BD9D-2F2C7CC93ECE • ios •
com.apple.CoreSimulator.SimRuntime.iOS-14-0 (simulator)
! Doctor found issues in 2 categories.
podfile:
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'YES'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end

There are problems with Flutter 1.20.4 and XCode12/iOS14.
You need to update Flutter to the current beta (1.22.0-12.3.pre) which contains a lot of fixes for the new iOS/XCode versions.
See https://flutter.dev/docs/development/ios-14
Edit 10/01/2020:
Flutter 1.22.0 has been released to stable and should work with XCode 12 and iOS 14 out of the box.

It might be a problem with the iOS Simulator.
Check out this forum.
You might want to reply to them pointing out this issue from the forum, seems to have worked for others.

Try to allow the module in xcode to see if it finds apple_sign_in
Open Xcode select Runner > Signing % Capabilities > +Capabilities > Select Apple_Sign_In
Xcode screenshot

Related

Flutter build iOS error CocoaPods not installed. Skipping pod install

Iam using Mac and upgraded to Android studio "Bumblebee", only in Mac when I try to do: Build -> Flutter -> Build iOS it shows this warning:
Warning: CocoaPods not installed. Skipping pod install. CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions. CocoaPods not installed or not in valid state. Process finished with exit code 1
But I did already this
gem install cocoapods Successfully installed cocoapods-1.11.2 Parsing documentation for cocoapods-1.11.2 Done installing documentation for cocoapods after 1 seconds 1 gem installed
When I do sudo gem install cocoapods I got:
ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /usr/bin directory.
I did Invalidate Caches and pod install also, but it still shows same warning.
Flutter doctor
[✓] Flutter (Channel stable, 2.8.1, on macOS 11.0.1 20B29 darwin-x64, locale en-GB)
• Flutter version 2.8.1 at /Users/test/Downloads/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (6 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/test/Library/Android/sdk
✗ cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[!] Xcode - develop for iOS and macOS (Xcode 12.5.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
! Flutter recommends a minimum Xcode version of 13.0.0.
Download the latest version or update via the Mac App Store.
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2021.1)
• Android Studio at /Users/test/Desktop/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
How to fix it?
Regards
close android studio
open terminal -> run open /Applications/Android\ Studio.app
try again ...
problem comes with new android studio version bumblebee
android studio started from macs dock is not able to reach the environment variables when its started from mac os dock
UPDATE:
run chmod +x /Applications/Android\ Studio.app/Contents/bin/printenv
now it works from dock
Just run this at terminal: run chmod +x /Applications/Android\ Studio.app/Contents/bin/printenv
The issue appears to be Cocopods not being installed with Big Sur or above. I found upgrading Ruby to a newer version and then installing Cocopods helped my coworker. Please follow the steps in the solution for installing Cocopods: Unable to install cocoa pods
It's now fixed with the latest patch on BumbleBee. Check this blog post.

Setting iOS Version for React Native app and iOS Simulator

I'm completely confused about targeting a particular version of iOS in my React Native app and the simulator version.
The simulator version is showing iPhone 12 - iOS 14.4 even though when I go to XCode -> Preferences -> Components, I see iOS 13.7 Simulator -- see below:
And when I try to launch the app, even though it succeeds building the app, I get the following warning and as soon as my app launches, it crashes. Here's the warning:
The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range supported deployment target versions is 9.0 to 14.4.99. (in target 'boost-for-react-native' from project 'Pods')
Here's my Podfile:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
platform :ios, '11.0'
target 'myapp' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
target 'myappTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!
post_install do |installer|
flipper_post_install(installer)
end
end
target 'myapp-tvOS' do
# Pods for myapp-tvOS
target 'ingridtm-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
Anyone can tell me what I'm doing wrong here and how to get these versions right?
P.S. I'm on a MacOS Catalina Version 10.15.7 and the XCode version is 12.4. Thanks
This picture indicates that you have iOS 13.7 Simulator installed, so you can run your app on iOS 13.7 Simulator. At the same time, Xcode always has the latest iOS version installed. So in your case, Xcode 12.4 is shipped with iOS 14.4. Therefore, it means that you can run your app on iOS 13.7 and iOS 14.4 simulators.
For the warning, check out this answer

Flutter - macOS; app run but cannot archive

I had a strange situation that when i run my app is running fine via command line (flutter run) or by using xCode.
But when I choose "Any Mac (Apple Silicon, Intel)" to archive, I got an error:
I tried different methods related with plugins problem, recommended in Github and here. For example, this one:
xCode -> Project -> Clean
deleted Podfile.lock and directory Pods
pod install
flutter clean, flutter run
Everything works smoothly until I try to archive.
This is my macOS Podfile:
platform :osx, '10.11'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_macos_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
end
This is the output of flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.26.0-2.0.pre.86, on Mac OS X 10.15.7 19H114 darwin-x64, locale en-IN)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] IntelliJ IDEA Community Edition (version 2020.3)
[✓] Connected device (3 available)
! Doctor found issues in 2 categories.
Do anyone have any ideas what to do?
Thank you in advance for your support.

I can't use Xcode simulator in VSCode (CocoaPods error)

Working with Flutter I tried to use Xcode simulator and I get the error in the picture.
I searched everywhere and following all the possible solutions but nothing is right (gem install commands, pod install(*[!] No Podfile found in the project directory*.), brew commands...).
However, if I tried the last app that I made and I have no problems running the simulator. Why with this project? Thank you in adv!
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.26.0-2.0.pre.131, on Mac OS X 10.15.7 19H15 darwin-x64, locale fr-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.52.1)
[✓] Connected device (2 available)
• No issues found!
Screenshot
Redit:
I figured it out. So it was missing 'a folder' or 'a file' in the IOS folder (either with or without Pods folder).
I do not know what was it to be more specific since I just change the directory (cd <your iOS folder>) and then recreate or update the folder (<flutter create .> .
You'll see that something will update then you can either try the pod install command or give it a shot and try the simulator (remember to go back to your project folder though) .

Your Xcode project requires migration

My project ios build fails after Xcode updating to 11.4.
steps from the manual (https://flutter.dev/docs/development/ios-project-migration) have already been made by flutter automatically(?) - everything written there has been done.
MacBook-Pro-ddd:my_awesome_project dm$ flutter clean
Cleaning Xcode workspace... 2,9s
Deleting build... 1ms
Deleting .dart_tool... 2ms
Deleting Generated.xcconfig... 0ms
Deleting flutter_export_environment.sh... 0ms
Deleting App.framework... 3ms
MacBook-Pro-ddd:my_awesome_project dm$ flutter build ios
Building ru.ddd.awesomeProject for device (ios-release)...
Your Xcode project requires migration. See https://flutter.dev/docs/development/ios-project-migration for details.
MacBook-Pro-ddd:my_awesome_project dm$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.0, on Mac OS X 10.15.4 19E287, locale ru-RU)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
[✓] Android Studio (version 3.6)
[!] IntelliJ IDEA Ultimate Edition (version 2020.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.44.2)
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
MacBook-Pro-ddd:my_awesome_project dm$
After following the official guides, Like #iluvatar_GR suggests delete App.Framework in addition also delete Flutter.framework from the Frameworks directory.
Run flutter clean and try running.
If there are any other errors other than project requires migration you might want to run rm -rf ios/Pods and try again.

Resources