错误描述
错误日志
Error (Xcode): In project/ios/Pods/OpenWeChatSDK/Pod/Library/lib/libWeChatSDK.a(WechatAuthSDK.o), building for iOS Simulator, but linking in object file built for iOS, file 'project/ios/Pods/OpenWeChatSDK/Pod/Library/lib/libWeChatSDK.a' for architecture arm64
Could not build the application for the simulator.
Error launching application on iPhone 11.
出错环境
flutter doctor
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.5.1 21G83 darwin-arm, locale zh-Hans-CN)
• Flutter version 3.0.5 at /Users/mtr/software/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f1875d570e (7 weeks ago), 2022-07-13 11:24:16 -0700
• Engine revision e85ea0e79c
• Dart version 2.17.6
• DevTools version 2.12.2
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /Users/mtr/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
• 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)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.2)
• IntelliJ at /Applications/IntelliJ IDEA.app
• 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
[✓] VS Code (version 1.70.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (4 available)
• Android SDK built for arm64 (mobile) • emulator-5554 • android-arm64 • Android 12 (API 31) (emulator)
• iPhone 11 (mobile) • 9F57523D-B573-45F9-BEE5-7D36FFE11129 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-5 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 12.5.1 21G83 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 104.0.5112.101
[!] HTTP Host Availability
✗ HTTP host "https://cocoapods.org/" is not reachable. Reason: Failed to connect to host in 10 seconds
✗ HTTP host "https://maven.google.com/" is not reachable. Reason: An error occurred while checking the HTTP host: Operation timed out
✗ HTTP host "https://cloud.google.com/" is not reachable. Reason: An error occurred while checking the HTTP host: Operation timed out
! Doctor found issues in 1 category.
Process finished with exit code 0
解决方案
在Xcode
中打开ios
项目
如下图,修改 Pods
-> Build Settings
-> Excluded Architectures
为 arm64
然后运行就可以了。
注意:
执行flutter clean
之后需要重新修改。