【发布时间】:2021-03-27 18:58:30
【问题描述】:
我想问一下如何为真实设备或模拟器编译我的 Flutter 应用程序。在出现这些问题之前,我可以编译 iOS 的 Flutter 应用,但是在 Xcode + Flutter + AS 的更新之后,突然不能再运行任何 Flutter 应用了。
Xcode 本身可以毫无问题地运行应用程序,但是当我执行命令flutter run 时出现以下错误:
Running Xcode build...
└─Compiling, linking and signing... 9.4s
Xcode build done. 36.5s
Failed to build iOS app
Error output from Xcode build:
↳
2020-12-17 11:10:56.911 xcodebuild[21278:254935] [MT] iPhoneConnect:
????<DVTiOSDevice (0x7fbfceca2180), xxx’s iPhone, iPhone, 13.5.1 (17F80),
00008020-000928A82293802E> == Underlying device preparation errors ==
2020-12-17 11:10:56.912 xcodebuild[21278:254935] [MT] iPhoneConnect: Failed
_shouldMakeReadyForDevelopment check even though device is not locked by
passcode.
Domain: com.apple.platform.iphoneos
Code: 5
Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform:
<DVTPlatform:0x7fbfcb11ed40:'com.apple.platform.iphoneos':<DVTFilePath:0x7fb
fcb11eac0:'/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneO
S.platform'>>. DTDKDeviceIdentifierIsIDID: 0
User Info: {
DVTDeviceDescription = "\Ud83d\Udcf1<DVTiOSDevice (0x7fbfceca2180),
xxx\U2019s iPhone, iPhone, 13.5.1 (17F80),
00008020-000928A82293802E>";
}
--
2020-12-17 11:10:56.912 xcodebuild[21278:254935] [MT] iPhoneConnect:
????<DVTiOSDevice (0x7fbfceca2180), xxx iPhone, iPhone, 13.5.1 (17F80),
00008020-000928A82293802E> == END: Underlying device preparation errors ==
** BUILD FAILED **
.........
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro.
这是我运行时遇到的错误(风味/新创建的项目)。目前,我无法使用 Xcode 运行任何风味,我只能从 Xcode 运行非风味项目。 到目前为止,我已经尝试过:
- https://github.com/flutter/flutter/issues/20685#issuecomment-421511890
- Android Studio cannot run the Xcode Simulator
- flutter clean && flutter run
- 退出 Xcode
- 关闭和重新打开 Xcode
- 在终端中杀死 Xcode。
如果您有任何想法,请告诉我。使用模拟器或真实设备时,我真的被这种错误困住了,谢谢!
【问题讨论】:
标签: ios iphone xcode flutter ios-simulator