我正在尝试为 iOS 构建 flutter。但是编译无法完成,因为没有找到模块
__ObjC
Launching lib/main.dart on iPhone 13 Pro Max in debug mode...
main.dart:1
Xcode build done. 42.7s
Failed to build iOS app
Swift Compiler Error (Xcode): Using bridging headers with module interfaces is unsupported
Uncategorized (Xcode): Command SwiftDriver emitted errors but did not return a nonzero exit code to indicate failure
Error (Xcode): no such module '__ObjC'
/Users/myname/Library/Developer/Xcode/DerivedData/Runner-gnvomxdvkbnvhiftqgeatxtbshib/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/arm64/Runner.private.swiftinterface:11:18
Error (Xcode): failed to verify module interface of 'Runner' due to the errors above; the textual interface may be broken by project issues or a compiler bug
/Users/myname/Library/Developer/Xcode/DerivedData/Runner-gnvomxdvkbnvhiftqgeatxtbshib/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/arm64/Runner.private.swiftinterface:0:0
Error (Xcode): no such module '__ObjC'
/Users/myname/Library/Developer/Xcode/DerivedData/Runner-gnvomxdvkbnvhiftqgeatxtbshib/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/arm64/Runner.swiftinterface:11:18
Error (Xcode): failed to verify module interface of 'Runner' due to the errors above; the textual interface may be broken by project issues or a compiler bug
/Users/myname/Library/Developer/Xcode/DerivedData/Runner-gnvomxdvkbnvhiftqgeatxtbshib/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/arm64/Runner.swiftinterface:0:0
Could not build the application for the simulator.
Error launching application on iPhone 13 Pro Max.
Exited
什么是__ObjC?将 Xcode 版本升级到 14.3 后会发生这种情况。 这怎么能解决?请有人回答。
[✓] Flutter (Channel stable, 3.7.6, on macOS 13.3.1 22E261 darwin-arm64, locale ja-JP)
• Flutter version 3.7.6 on channel stable at /Users/myname/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 12cb4eb7a0 (6 weeks ago), 2023-03-01 10:29:26 -0800
• Engine revision ada363ee93
• Dart version 2.19.3
• DevTools version 2.20.1
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at /Users/myname/Library/Android/sdk
• Platform android-33, 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.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14E222b
• CocoaPods version 1.12.0
[✓] 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.77.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.62.0
[✓] Connected device (3 available)
• iPhone 13 Pro Max (mobile) • 63E17FF6-0922-418E-A209-49173C8A4E71 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-4 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 13.3.1 22E261 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 112.0.5615.49
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!