ios - Flutter 无法用 IOS 模拟器构建应用
问题描述
我是 Flutter 的新手,我在我的 Macbook Pro 上设置了 Flutter。Xcode 11.3.1(11C505)
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Mac OS X 10.14.6 18G4032, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Android Studio (version 3.6)
[✓] IntelliJ IDEA Community Edition (version 2018.3.6)
[✓] VS Code (version 1.44.2)
[✓] Connected device (1 available)
• No issues found!
它适用于 Android 模拟器。但是,它不适用于IOS。
我尝试了“flutter clean”,但没有奏效。似乎 Xcode 端错误,但不知道该怎么做。
Launching lib/main.dart on iPhone 11 in debug mode...
Xcode build done. 57.2s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
While building module 'Flutter' imported from /Users/hb2746ap/AndroidStudioProjects/test_app/ios/Runner/GeneratedPluginRegistrant.h:8:
While building module 'UIKit' imported from /Users/hb2746ap/AndroidStudioProjects/test_app/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:8:
While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
In file included from <module-includes>:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:109:12: error: attributes may not be specified on a category
@interface NSArray<ObjectType> (NSArrayDiffing)
.........
Skipped
.........
~~~~~~~~^
1 error generated.
15 errors generated.
In file included from /Users/hb2746ap/AndroidStudioProjects/test_app/ios/Runner/GeneratedPluginRegistrant.m:5:
/Users/hb2746ap/AndroidStudioProjects/test_app/ios/Runner/GeneratedPluginRegistrant.h:8:9: fatal error: could not build module 'Flutter'
#import <Flutter/Flutter.h>
~~~~~~~^
16 errors generated.
Could not build the application for the simulator.
Error launching application on iPhone 11.
Exited (sigterm)
解决方案
推荐阅读
- php - sqlsrv_query , php 传入的表格数据流 (TDS) 远程过程调用 (RPC) 协议流不正确
- machine-learning - 当特征不相关时,皮尔逊相关说明了什么
- arduino - 为什么 Radiohead 库的接收字符数组的方法使用传递引用作为数组长度?
- firebase - 使用 JWT 令牌进行初始身份验证但从那时起表达会话是否安全?
- javascript - 在超链接末尾添加数据层变量的值
- survey - 如何在 SurveyMonkey 中添加单选题?
- autodesk-forge - 将模型上传到 BIM360 Design,而不是 BIM360 Docs
- c++ - GRPC C++ 非阻塞服务器
- ios - swift isUserInteractionEnabled = false 在 UITapGestureRecognizer 内不起作用
- snowflake-cloud-data-platform - 确定聚类关键雪花