Hi am facing an issue while running flutter project in MacBook Air M1 chip Lap. Tried all possibilities couldn't find where is the exact problem.
All basic solutions like flutter clean, flutter pub get, pod deintegrate & install, flutter build ios, flutter run
but still same issue. only on iOS simulator not deploying.
Any solution for this. Thanks in advance.
Error
Launching lib/main.dart on iPhone 13 in debug mode...
Running pod install... 5.3s
Running Xcode build...
Xcode build done. 104.1s
Failed to build iOS app
Error output from Xcode build:
↳
objc[25282]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x203913130) and
/Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x103bc02c8). One of the two will be used. Which one is undefined.
objc[25282]: Class AMSupportURLSession is implemented in both /usr/lib/libamsupport.dylib (0x203913180) and
/Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x103bc0318). One of the two will be used. Which one is undefined.
** BUILD FAILED **
flutter doctor -v
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.0.1 21A559 darwin-arm, locale
en-IN)
• Flutter version 2.8.1 at
/Users/macsystem/Documents/developer/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (7 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.0.0)
• Android SDK at /Users/macsystem/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.10+0-b96-7249189)
• 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 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-7249189)
[✓] Connected device (2 available)
• iPhone 13 (mobile) • 05EC9698-3C26-44B9-8DB0-B53C7B6576F3 • ios
• com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
• Chrome (web) • chrome • web-javascript
• Google Chrome 97.0.4692.99
I've done complete clean and install by below steps and it helped me to solve,
Step 1:
flutter clean
rm -Rf ios/Pods
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec
rm ios/Podfile
Step 2:
cd ios
flutter pub get
pod cache clean --all
pod install
or (below for m1 chip incase above command thrown error in pod install)
#1 Install ffi
sudo arch -x86_64 gem install ffi
#2 Re-install dependencies
arch -x86_64 pod install
Step 3:
1. Open ios/Pods/Pods.xcodeproj in Xcode
2. Change the iOS Deployment info from 8.0 to 9.0
Step 4:
From xcode clean / build again / run. Hope this should work. Before please confirm whether all the build settings for iOS configured properly or not.
Note: In those above steps i faced one more issue from Firebase like "firebase import not found". Below added steps how i solved.
Step 1: open ios/Podfile
Check platform :ios, '10.0' is uncommented
Step 2:
add below code at end of Podfile
target 'CustomImageNotifications' do
use_frameworks!
pod 'Firebase/Analytics'
pod 'Firebase/Messaging'
end
Step 3: pod install & open xcode and clean / build.
Hoping this answer may helps.! thanks