Failed to build iOS app Error (Xcode): Expected Flutter XXX, but found XXX - xcode

Just upgraded to flutter 3.7.3 on channel stable. Running on ios simulator works fine, but when I try to archive project:
Failed to build iOS app
Error (Xcode): Expected Flutter 857bd6b74c5eb56151bfafe91e7fa6a82b6fee25, but found 248290d6d50a1bf1a6a246544347c03acda867a5
Encountered error while archiving for device.
Flutter doctor is:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.3, on macOS 13.0 22A380 darwin-arm64, locale fr-FR)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
✗ 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 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.75.1)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

Found the fix:
This issue happens when you generated a shader compilation jank. In the generated file (i.e flutter_01.sksl.json) you have to change the Flutter version. Preferably you run the SkSL warmup again with the new flutter version

Related

Lexical or Preprocessor Issue Group: Flutter.h file not found

I have a flutter app and I recently migrated to a macbook M1, and I started getting this error. I already tried the following steps:
Remove iOS folder and create a new one
pod deintegrate -> flutter clean -> flutter pub cache repair -> pod install -> sudo gem install cocoa-pods
rm Flutter/Flutter.podspec, rm Podfile.lock
The output:
fatal error: 'Flutter/Flutter.h' file not found
#import "Flutter/Flutter.h"
My flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.0, on macOS 12.1 21C52 darwin-arm, locale pt-BR)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.64.2)
[✓] Connected device (2 available)
• No issues found!

Flutter - XCode Command PhaseScriptExecution failed with a nonzero exit code - Mac M1

I see this issue has been raised, but I haven't managed to solve it.
I got new Mac Mini M1 chip.
I am getting this problem when running the flutter app on ios simulator. Android works fine.
Happens with new and old projects alike.
Failed to package /Users/reuvenberman/StudioProjects/yet_again.
Command PhaseScriptExecution failed with a nonzero exit code
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-arm, locale
en-IL)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] Connected device (2 available)
• No issues found!
I don't know why this worked, but it did.
I switched to Flutter master channel, then it worked. Then I switched back to stable channel, and it still works.
This took me 3 days, and still don't understand.

Migration from Windows to Mac: Error on Podfile installation

I just migrated a flutter app made on Windows10, to the Mac, and had problems with the app's execution. I searched the internet for similar errors and found several solutions, but none of them solved my case. I tried to delete the files podfile.lock, Podfile, .symlinks, Flutter.Frameword, Fullet.podspec, pubspec.lock, and after that, the code execution (with flutter run) returned this:
Error running pod install
I tried to run this line of code:
"pod install --repo-update"
And I received this:
[!] Unable to find a target named 'FirebaseApp' in project 'Runner.xcodeproj', did find 'Runner'.
I've tried several things and I don't know what's going on.
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.6 19G2021, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.0)
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.51.0)
[✓] Connected device (1 available)
• No issues found!
My app is connected to Firebase, android, and I'm studying flutterfire with iOS.
Open the terminal, navigate to the project, and type rm ios/Podfile
After that build the project with flutter build ios

Flutter stable 1.17.1 and Xcode 11.5 issues

After upgrading to Flutter 1.17.1 and Xcode 11.5, I cannot build for iOS anymore.
Despite following all the direction in https://flutter.dev/docs/development/ios-project-migration
Anyone faces the same issue? Any solution?
flutter doctor
Waiting for another flutter command to release the startup lock...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.1, on Mac OS X 10.15.4 19E287, locale en-SG)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
[✓] Android Studio (version 3.6)
[!] Android Studio (version 2.3)
✗ Flutter plugin version 12.1 - the recommended minimum version is 16.0.0
[✓] VS Code (version 1.45.1)
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
Here is the output when I do
flutter run
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Your Xcode project requires migration. See https://flutter.dev/docs/development/ios-project-migration for details.
Error launching application on iPhone 11 Pro Max.
Yes, in addition, I have to remove the above.
thanks
Came from 1.13=>1.17. It did not upgrade my project automatically so I had to work a bit in Xcode. I solved the issue by executing all steps listed on the migration page. Then executing:
rm -rf ios/Flutter/App.framework
rm -rf ios/Pod*
flutter clean
Build and run => success

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