简体   繁体   中英

Flutter cannot build for iOS after Xcode upgrade

I have an old project that didn't work on in the last 8 months and came back this week. No code changes nothing, I just updated to Xcode Version 12.4 (12D4e) as my iPhone iOS is upgraded and could not run the app.

Now I'm facing lots of troubles, cannot build anymore for iOS

I got these errors

Building for iOS, but the linked and embedded framework 'Flutter. framework' was built for iOS + iOS Simulator.

I tried all sort of things without success like

  1. flutter clean
  2. rm -rf ios/Pods && cd ios/; pod install --repo-update
  3. rm -rf ios/Flutter/App.framework

All the above together and nothing worked to get rid of the error.

My flutter version

Flutter 1.12.13+hotfix.8 • channel unknown • unknown source
Framework • revision 0b8abb4724 (1 year, 4 months ago) • 2020-02-11 11:44:36 -0800
Engine • revision e1e6ced81d
Tools • Dart 2.7.0

Flutter doctor is also happy

[✓] Flutter (Channel unknown, v1.12.13+hotfix.8, on macOS 11.4 20F71, locale en-DE)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
[✓] Android Studio (version 3.5)

I knew my flutter version is old, so please don't suggest updating. Updating is very hard as I tried but I have to update all code and many libraries are not available in the new version.

So please flutter experts any idea how to solve this?

Update 1 June 2021: I downgraded to old xcode version by downloading manually Version 11.4 (11E146) . I could build archive fine here the app, then trying to publish in app store I got this error:

SDK Version Issue. This app was built with the iOS 13.4 SDK. All iOS apps submitted to the App Store must be built with the iOS 14 SDK or later, included in Xcode 12 or later.

So I cannot downgrade, or use new one I got stuck in changing and deploying the ios version...

Try following

flutter clean
rm -Rf ios/Pods
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM