Jai*_*Jai 24 ios ios-simulator dart flutter
您好,在 MacBook Air M1 芯片 Lap 中运行 flutter 项目时遇到问题。尝试了所有的可能性都找不到具体问题出在哪里。
\n所有基本解决方案如flutter clean, flutter pub get, pod deintegrate & install, flutter build ios, flutter run
,但仍然是相同的问题。仅在未部署的 iOS 模拟器上。
任何解决方案。提前致谢。
\n错误
\nLaunching lib/main.dart on iPhone 13 in debug mode...\nRunning pod install... 5.3s\nRunning Xcode build... \nXcode build done. 104.1s\nFailed to build iOS app\nError output from Xcode build:\n\xe2\x86\xb3\n objc[25282]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x203913130) and\n /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x103bc02c8). One of the two will be used. Which one is undefined.\n objc[25282]: Class AMSupportURLSession is implemented in both /usr/lib/libamsupport.dylib (0x203913180) and\n /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x103bc0318). One of the two will be used. Which one is undefined.\n ** BUILD FAILED **\n
Run Code Online (Sandbox Code Playgroud)\n扑动医生-v
\n[\xe2\x9c\x93] Flutter (Channel stable, 2.8.1, on macOS 12.0.1 21A559 darwin-arm, locale\n en-IN)\n \xe2\x80\xa2 Flutter version 2.8.1 at\n /Users/macsystem/Documents/developer/flutter\n \xe2\x80\xa2 Upstream repository https://github.com/flutter/flutter.git\n \xe2\x80\xa2 Framework revision 77d935af4d (7 weeks ago), 2021-12-16 08:37:33 -0800\n \xe2\x80\xa2 Engine revision 890a5fca2e\n \xe2\x80\xa2 Dart version 2.15.1\n\n[\xe2\x9c\x93] Android toolchain - develop for Android devices (Android SDK version 32.0.0)\n \xe2\x80\xa2 Android SDK at /Users/macsystem/Library/Android/sdk\n \xe2\x80\xa2 Platform android-32, build-tools 32.0.0\n \xe2\x80\xa2 Java binary at: /Applications/Android\n Studio.app/Contents/jre/Contents/Home/bin/java\n \xe2\x80\xa2 Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)\n \xe2\x80\xa2 All Android licenses accepted.\n\n[\xe2\x9c\x93] Xcode - develop for iOS and macOS (Xcode 13.2.1)\n \xe2\x80\xa2 Xcode at /Applications/Xcode.app/Contents/Developer\n \xe2\x80\xa2 CocoaPods version 1.11.2\n\n[\xe2\x9c\x93] Chrome - develop for the web\n \xe2\x80\xa2 Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome\n\n[\xe2\x9c\x93] Android Studio (version 2020.3)\n \xe2\x80\xa2 Android Studio at /Applications/Android Studio.app/Contents\n \xe2\x80\xa2 Flutter plugin can be installed from:\n https://plugins.jetbrains.com/plugin/9212-flutter\n \xe2\x80\xa2 Dart plugin can be installed from:\n https://plugins.jetbrains.com/plugin/6351-dart\n \xe2\x80\xa2 Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)\n\n[\xe2\x9c\x93] Connected device (2 available)\n \xe2\x80\xa2 iPhone 13 (mobile) \xe2\x80\xa2 05EC9698-3C26-44B9-8DB0-B53C7B6576F3 \xe2\x80\xa2 ios\n \xe2\x80\xa2 com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)\n \xe2\x80\xa2 Chrome (web) \xe2\x80\xa2 chrome \xe2\x80\xa2 web-javascript\n \xe2\x80\xa2 Google Chrome 97.0.4692.99\n
Run Code Online (Sandbox Code Playgroud)\n
Jai*_*Jai 10
我已经通过以下步骤完成了完整的清理和安装,它帮助我解决了,
步骤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
Run Code Online (Sandbox Code Playgroud)
第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
Run Code Online (Sandbox Code Playgroud)
步骤3:
1. Open ios/Pods/Pods.xcodeproj in Xcode
2. Change the iOS Deployment info from 8.0 to 9.0
Run Code Online (Sandbox Code Playgroud)
步骤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.
Run Code Online (Sandbox Code Playgroud)
注意:在上述步骤中,我遇到了 Firebase 的另一个问题,例如“未找到 firebase import”。下面添加了我如何解决的步骤。
第1步:打开ios/Podfile
Check platform :ios, '10.0' is uncommented
Run Code Online (Sandbox Code Playgroud)
第2步:
在 Podfile 末尾添加以下代码
target 'CustomImageNotifications' do
use_frameworks!
pod 'Firebase/Analytics'
pod 'Firebase/Messaging'
end
Run Code Online (Sandbox Code Playgroud)
步骤3: pod install & open xcode and clean / build.
希望这个答案可以有所帮助。!谢谢
我通过兼容模式运行 pod update 解决了这个问题
% flutter clean
% cd ios
% arch -x86_64 pod update
Run Code Online (Sandbox Code Playgroud)
小智 5
我很幸运,首先删除了 Flutter.podspec,然后运行 flutter clean。我使用的是 Mac Mini M1。
$ rm ios/Flutter/Flutter.podspec
$ flutter clean
Run Code Online (Sandbox Code Playgroud)
在这里找到:
https://github.com/flutter/flutter/issues/70895#issuecomment-744734693
归档时间: |
|
查看次数: |
10566 次 |
最近记录: |