Invalid Binary issue in flutter IOS build - ios

So, yesterday I build an app for ios, archive it and upload it to AppStore connect through xcode, everything seemed good but after few moments I received an email from apple saying:
Dear Developer,
We identified one or more issues with a recent delivery for your app, "APP-NAME" 1.0.1 (2). Please correct the following issues, then upload again.
ITMS-90755: Invalid Binary - The following binaries in your app contains prohibited instructions: /Volumes/data01/app_data/awf/SWImportWorker-mr47p00ce-swpr0068.cse.apple.com-300252/ff03-SoftwareImportWorker-MR_.0/NYH74E2GDJSTMWPVXUPB4IZWH4/umuagyjihbsjsrpn/wspvjpsuvltmmknh/Payload/Runner.app/Frameworks/App.framework/App. Remove the instructions from the binaries, rebuild and resubmit.
Best regards,
The App Store Team
I tried again with flutter clean and also increased the IOS deployment target but it didn't help.
My device's Flutter info:
Flutter (Channel stable, 2.5.0, on macOS 11.5.2 20G95 darwin-x64, locale
en-PK)
• Flutter version 2.5.0 at /Users/niteshkongreja/Development/flutter
• Upstream repository https://github.com/niteshcongreja321/flutter.git
• Framework revision 4cc385b4b8 (10 days ago), 2021-09-07 23:01:49 -0700
• Engine revision f0826da7ef
• Dart version 2.14.0
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/niteshkongreja/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• ANDROID_HOME = /Users/niteshkongreja/Library/Android/sdk
• Java binary at: /Applications/Android
Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5.1, Build version 12E507
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/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.10+0-b96-7281165)
[✓] VS Code (version 1.60.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.26.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-x64 • macOS 11.5.2 20G95 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 93.0.4577.82
• No issues found!

All I had to do was revoke my certificate, delete the mobileprovision file, then recreate both.
I also changed over to Air SDK 3.7.0.1530 and included the Default-568h#2x.png for the iphone splash screen, and well... it seems to have worked.

Related

PhaseScriptExecution error but doesn't specify the problem

I know this problem already exists everywhere, but I tried most of the solutions of this and still none of them work. The log doesn't seem to specify what's the problem, only shows the said PhaseScriptExecution error.
What else can I do to solve this?
Tried running, re-running, deleting pods files, cleaning, rebuilding, etc.
I'm trying to run a flutter app in a physical device.
Also tried running in a clean project, but the same error persists.
XCode 13.4.1
MBPM1
flutter doctor -v :
Flutter (Channel master, 3.4.0-30.0.pre.19, on macOS 12.4 21F79 darwin-arm64, locale en-PT)
• Flutter version 3.4.0-30.0.pre.19 on channel master at /Users/henriqueguima/work/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f2c6033739 (4 months ago), 2022-09-26 03:50:27 -0400
• Engine revision 53a7659ea1
• Dart version 2.19.0 (build 2.19.0-240.0.dev)
• DevTools version 2.17.0
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /Users/henriqueguima/Library/Android/sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 13F100
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2)
• Android Studio at /Applications/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.12+0-b1504.28-7817840)
[✓] VS Code (version 1.74.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.58.0
[✓] Connected device (3 available)
• iPhone (mobile) • 2c12eaae0fc97e504f295ea6cb964ab6904f42cd • ios • iOS 15.7.2 19H218
• macOS (desktop) • macos • darwin-arm64 • macOS 12.4 21F79 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 109.0.5414.119
! Error: iPhone is busy: Making iPhone ready for development. Xcode will continue when iPhone is finished. (code -10)
[✓] HTTP Host Availability
• All required HTTP hosts are available
XCode log -- https://pastebin.com/r0RLjiAP
EDIT: downgrade didn't work either

I am getting this error "ld: framework not found Flutter" after upgrade xcode latest Version 13.4.1 (13F100). tried all solution but not succeed

This is the screenshot of error after running the app
Here is
flutter doctor -v
[✓] Flutter (Channel stable, 3.0.2, on macOS 12.4 21F79 darwin-arm, locale en-IN)
• Flutter version 3.0.2 at /Users/magespider/Developer/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision cd41fdd495 (9 days ago), 2022-06-08 09:52:13 -0700
• Engine revision f15f824b57
• Dart version 2.17.3
• DevTools version 2.12.2
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
• Android SDK at /Users/magespider/Library/Android/sdk
• Platform android-32, build-tools 32.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2)
• Android Studio at /Applications/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.12+0-b1504.28-7817840)
[✓] VS Code (version 1.68.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.42.0
[✓] Connected device (2 available)
• macOS (desktop) • macOS • darwin-arm64 • macOS 12.4 21F79 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 102.0.5005.115
! Error: Bhavin’s iPod is not connected. Xcode will continue when Bhavin’s iPod is connected. (code -13)
! Error: iPhone is busy: Waiting to connect and unlock the device. Xcode will continue when iPhone is finished. (code -10)
! Error: iPhone is not connected. Xcode will continue when iPhone is connected. (code -13)
! Error: Bhavin’s iPhone is not connected. Xcode will continue when Bhavin’s iPhone is connected. (code -13)
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
Please help to resolve this issue, Thanks in advance
I tried the following solution
Deleted ios folder and then recreated
pod deintegrate, install
delete podfile, podfile.lock the Pods folder, and install the pod again.
tried to change the Other Linker Flag in Runner -> Build settings,
Added arm64 in Excluded Architecture.

Android studio "flutter run" working but Run button not working

When I click the android studio run button, I get the following error and no matter how many methods I tried, it doesn't work, but when I type the "flutter run" command, it works.
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.
Exception: CocoaPods not installed or not in valid state.
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.0.1 21A559 darwin-x64, locale
tr-TR)
• Flutter version 2.8.1 at /Users/aksoyhlc/flutter/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
32.1.0-rc1)
• Android SDK at /Users/aksoyhlc/Library/Android/sdk
• Platform android-32, build-tools 32.1.0-rc1
• Java binary at: /Applications/Android
Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.1)
• Android Studio at /Applications/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)
[✓] Connected device (2 available)
• Aksoyhlc iPhone’u (mobile) •----- •
ios • iOS 14.7.1 18G82
• Chrome (web) • chrome •
web-javascript • Google Chrome 97.0.4692.99
I had this issue sometimes, the only way i found was to uninstall cocoapods, reinstall it and relaunch the IDE. Check the steps todo here: https://stackoverflow.com/a/64000509/9043877

error: "failed to emit precompiled header " when trying to build release version for ios in flutter project

I am trying to build release version for ios in flutter project but getting error. i have successfully build for android and is ready to be release in play store but could not build for ios.
<unknown>:0: error: failed to emit precompiled header '-----/Library/Developer/Xcode/DerivedData/Runner-ffcffkmbdhvzbvdreompnmykxuan/Build/Intermediates.noindex/PrecompiledHeaders/Runner-Bridging-Header-swift_2UQTBPBSI3S8D-clang_7BTRW3ZHWAY7.pch' for
bridging header '----------/ios/Runner/Runner-Bridging-Header.h'
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
my flutter doctor -v gives
[✓] Flutter (Channel stable, 2.5.3, on macOS 11.2 20D64 darwin-x64, locale en-GB)
• Flutter version 2.5.3 at /Volumes/Macintosh HD - Data/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 18116933e7 (10 weeks ago), 2021-10-15 10:46:35 -0700
• Engine revision d3ea636dc5
• Dart version 2.14.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/applefriend/Library/Android/sdk
• Platform android-31, 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 11.0.8+10-b944.6916264)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.2)
• Android Studio at /Applications/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.8+10-b944.6916264)
[✓] Connected device (2 available)
• iPhone 12 Pro Max (mobile) • A54713A9-6BB0-42E6-85C6-7F337B206109 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.110
• No issues found!

Failed to launch iOS Simulator: Error: Emulator didn't connect within 60 seconds

Flutter doctor -v(same result with and without ios simulator running)
flutter doctor -v
[✓] Flutter (Channel stable, 2.2.3, on Mac OS X 10.14.6 18G103 darwin-x64, locale en-US)
• Flutter version 2.2.3 at /Users/faizan/Developer/flutter
• Framework revision f4abaa0735 (8 weeks ago), 2021-07-01 12:46:11 -0700
• Engine revision 241c87ad80
• Dart version 2.13.4
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/faizan/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• ANDROID_HOME = /Users/faizan/Library/Android/sdk
• Java binary at: /Library/Java/JavaVirtualMachines/jdk1.8.0_301.jdk/Contents/Home/bin/java
• Java version Java(TM) SE Runtime Environment (build 1.8.0_301-b09)
• All Android licenses accepted.
[!] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.1, Build version 10B61
✗ Xcode 10.1.0 out of date (12.0.1 is recommended).
Download the latest version or update via the Mac App Store.
• CocoaPods version 1.10.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio (version 2020.3)
• Android Studio at /Applications/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
✗ Unable to find bundled Java version.
• Try updating or re-installing Android Studio.
[✓] VS Code (version 1.59.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.25.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-x64 • Mac OS X 10.14.6 18G103 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.159
! Doctor found issues in 2 categories.
No devices in bottom tab of vscode even i started the ios simulator. Same happens with android studio
I tried both 12.0.1 xcode and 10.1 with and without command line tools
Go to your system activity monitor, search for simulator, double click on it, then quit ==> then fore quit.
It should work afterwards. Don't know why it happens, but it's not the first time, happens on and off.

Resources