应用程序不能在模拟器或存档上运行,设备工作
Posted
技术标签:
【中文标题】应用程序不能在模拟器或存档上运行,设备工作【英文标题】:App doesn't run on simulators or archive, devices work 【发布时间】:2021-12-27 22:41:40 【问题描述】:应用程序不能在 ios 模拟器或构建存档上运行,而是在设备上运行。 它曾经运行良好,突然(无法确定当前可能导致这种情况的不同之处)在 android 上发生了类似的问题,在多次颤振清理后文件名太长错误,然后删除它在真实设备上工作的所有缓存再次在模拟器上,但不适用于 IOS。
错误信息
/Users/yassin/Library/Developer/Xcode/DerivedData/Runner-dnjtfjbcotehrpgzrmybaaeugzpl/Build/Intermediates.noindex/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/Applications/Runner.app: File name too long Command CodeSign failed with a nonzero exit code
Unhandled error domain NSPOSIXErrorDomain, code 63
关于从 xcode 运行模拟器时出现的错误的更多详细信息:
Failure Reason: Unhandled error domain NSPOSIXErrorDomain, code 63 User Info: FunctionName = IXCopyItemAtURL; IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher; SourceFileLine = 121;
我注意到一个奇怪的行为是,dart 分析需要很长时间才能启动,并且在设备上运行时,它会在正常时间内构建,但安装时间很长(4 分钟以上)在 Macbook M1 上,两者android 和 ios 这是不寻常的。
颤振医生
[✓] Flutter (Channel stable, 2.5.3, on macOS 11.6 20G165 darwin-arm, locale
en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.61.0)
我尝试过的事情:
-
Flutter clean + Flutter pub 获取
删除 xcodes 派生数据文件夹 + 重新启动笔记本电脑和 xcode
flutter pub 缓存修复
Pod 安装、更新
吊销所有证书,安装新证书
关闭自动签名,下载配置文件
锁定和解锁钥匙串登录访问。
Flutter 运行 --verbose 错误日志:
An error was encountered processing the command
(domain=NSPOSIXErrorDomain, code=63):
copyfile of
file:///Users/yassin/Desktop/Projects/handles/build/ios/ipho
nesimulator/Runner.app/ to
file:///Users/yassin/Library/Developer/CoreSimulator/Devices
/B864AB8C-79BE-4A09-9351-DDCA31E8C22F/data/Containers/Shared
/SystemGroup/systemgroup.com.apple.installcoordinationd/Libr
ary/InstallCoordination/PromiseStaging/C21EB07A-E655-4BBA-8B
07-5DA8B5397AE4/Runner.app failed: File name too long
Unhandled error domain NSPOSIXErrorDomain, code 63
[ +15 ms] Unable to install
/Users/yassin/Desktop/Projects/handles/build/ios/iphonesimulator/Runner.app on
B864AB8C-79BE-4A09-9351-DDCA31E8C22F. This is sometimes caused by a
malformed
plist file:
ProcessException: Process exited abnormally:
An error was encountered processing the command
(domain=NSPOSIXErrorDomain,
code=63):
copyfile of
file:///Users/yassin/Desktop/Projects/handles/build/ios/iphonesimulator/Runner.a
pp/ to
file:///Users/yassin/Library/Developer/CoreSimulator/Devices/B864AB8C-79BE-4A09-
9351-DDCA31E8C22F/data/Containers/Shared/SystemGroup/systemgroup.com.apple.insta
llcoordinationd/Library/InstallCoordination/PromiseStaging/C21EB07A-E655-4BBA-8B
07-5DA8B5397AE4/Runner.app failed: File name too long
Unhandled error domain NSPOSIXErrorDomain, code 63
Command: /usr/bin/arch -arm64e xcrun simctl install
B864AB8C-79BE-4A09-9351-DDCA31E8C22F
/Users/yassin/Desktop/Projects/handles/build/ios/iphonesimulator/Runner.app
[ +7 ms] Error launching application on iPhone 12.
[ +10 ms] "flutter run" took 445,079ms.
[ +14 ms]
#0 throwToolExit
(package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand
(package:flutter_tools/src/commands/run.dart:669:9)
<asynchronous suspension>
#2 FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:1125:27)
<asynchronous suspension>
#3 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#4 CommandRunner.runCommand
(package:args/command_runner.dart:209:13)
<asynchronous suspension>
#5 FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:288:9)
<asynchronous suspension>
#6 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand
(package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
<asynchronous suspension>
#8 run.<anonymous closure>.<anonymous closure>
(package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
#9 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#10 main (package:flutter_tools/executable.dart:92:3)
<asynchronous suspension>?
【问题讨论】:
【参考方案1】:几天后对我有用的是删除项目文件夹中的所有隐藏文件,除了 git 相关文件、.idea、.packages 等。以及 podspec.lock 和 手动构建文件夹。
对遇到相同问题的其他人有用的是“删除颤振安装文件夹,然后从 repo 中再次获取”
这两个选项都有望解决您的问题。
【讨论】:
以上是关于应用程序不能在模拟器或存档上运行,设备工作的主要内容,如果未能解决你的问题,请参考以下文章
谷歌地图可以在模拟器上工作,但不能在 React 本机 APP 的 android 设备上工作
PhoneGap App 在模拟器上工作,但在 iPhone 设备上不能正常工作