命令CompileAssetCatalog失败,出现非零退出代码

Mic*_*ell 17 xcode compiler-errors build

运行Xcode 10并且似乎无法找到有关构建项目时出现的此错误的更多信息.

有想法该怎么解决这个吗?

这是错误之前的最后一行:

Desktop/CheerApp!/ CheerApp!/Assets.xcassets命令CompileAssetCatalog失败并带有非零退出代码 -

扩展:

CompileAssetCatalog /Users/michaelansell/Library/Developer/Xcode/DerivedData/CheerApp!-ehbjnqaldsycfegiviymewkplqhm/Build/Products/Debug-iphonesimulator/CheerApp!.app /Users/michaelansell/Desktop/CheerApp!/CheerApp!/Assets.xcassets(在目标中) :CheerApp!)cd/Users/michaelansell/Desktop/CheerApp!/Applications/Xcode.app/Contents/Developer/usr/bin/actool --output-format human-readable-text --notices --warnings --export-dependency-info/Users/michaelansell/Library/Developer/Xcode/DerivedData/CheerApp!-ehbjnqaldsycfegiviymewkplqhm/Build/Intermediates.noindex/CheerApp!.build/Debug-iphonesimulator/CheerApp!.build/assetcatalog_dependencies --output-partial-info-plist/Users/michaelansell/Library/Developer/Xcode/DerivedData/CheerApp!-ehbjnqaldsycfegiviymewkplqhm/Build/Intermediates.noindex/CheerApp!.build/Debug-iphonesimulator/CheerApp!.build/assetcatalog_generated_info.plist --app-icon AppIcon --compress-pngs --enable-on-demand-resources YES - -optimization space --filter-for-device-model iPhone11,2 --filter-for-device-os-version 12.0 --sticker-pack-identifier-prefix Mike.CheerApp-.sticker-pack.--target-device iphone --target-device ipad --minimum-deployment-target 11.4 --platform iphonesimulator --product-type com.apple.product-type.application --compile/Users/michaelansell/Library/Developer/Xcode中/ DerivedData/CheerApp!-ehbjnqaldsycfegiviymewkplqhm /编译/产品/调试,iphonesimulator /

小智 20

我设法通过执行"构建清理",删除" DerivedData "文件夹并重新启动我的Mac 来解决这个问题.


mar*_*hiz 14

如果您已经打开了多个版本的 Xcode,则可能需要重新启动 Xcode CoreSimulatorService,这是一种邪恶的后台服务,尽管它仅与一个版本兼容,但它以某种方式保持在线并可用于许多版本的 Xcode,并清理相关文件。

就我而言,Xcode 13.2.1、13.4.1 和 14-beta 之间似乎存在兼容性问题。经过几个小时的搜索,以下命令终于将我从重新启动、重新安装和删除 DerivedData 的深渊中拉了出来。

# Make sure the correct version of Xcode is selected
xcode-select -p

# Clear out conflicting devices here, if any
rm -rf ~/Library/Developer/CoreSimulator/Devices

# Trigger the Simulator service to restart
sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService

# Clean up Xcode simulator references
xcrun simctl delete unavailable
Run Code Online (Sandbox Code Playgroud)

如果仅此方法不起作用,则可能存在由冲突版本的 Xcode 安装的问题CoreSimulatorService,甚至重新启动也无法解决您的情况。您可以看到该守护进程是从系统上的全局目录运行的,该目录由 Xcode 在首次启动时的安装脚本中初始化:

$ ps aux | grep CoreSimulator
user    13668   0.0  0.0 408883856  17760   ??  S     9:52AM   0:00.05 /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/XPCServices/SimulatorTrampoline.xpc/Contents/MacOS/SimulatorTrampoline
user    13665   0.0  0.0 408765760  25248   ??  S     9:52AM   0:03.20 /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/XPCServices/com.apple.CoreSimulator.CoreSimulatorService.xpc/Contents/MacOS/com.apple.CoreSimulator.CoreSimulatorService
root              2161   0.0  0.0 408612544  10432   ??  Ss    9:29AM   0:06.33 /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Resources/bin/simdiskimaged
user     2158   0.0  0.0 408574240   7088   ??  S     9:29AM   0:00.07 /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/XPCServices/SimLaunchHost.arm64.xpc/Contents/MacOS/SimLaunchHost.arm64
Run Code Online (Sandbox Code Playgroud)

这有点复杂,因为它需要/Library/Developer/在 Xcode 重新启动以替换损坏的版本之前清除该目录。

rm -rf /Library/Developer/**
Run Code Online (Sandbox Code Playgroud)

请注意,您Terminal.app或您用于 shell 的任何内容都需要完整的磁盘访问权限才能执行此操作,如下System Preferences > Security & Privacy > Full Disk Access > [Terminal.app]

重新安装应该在启动所需版本的 Xcode 后启动,但您也可以手动运行其中的安装 pkg 文件来重新执行此安装过程/Application/<Xcode.app>/Contents/Resources/Packages/

此问题的其他症状:模拟器未显示在Window > Devices and Simulators列表中并simctl抛出错误,并且无法找到类似于以下内容的基本 iOS SDK:

$ xcrun simctl list
...
-- Unavailable: com.apple.CoreSimulator.SimRuntime.iOS-15-5 --
    iPhone 8 (55A90310-8202-4A0D-968B-00F440D42210) (Shutdown) (unavailable, runtime profile not found)
Run Code Online (Sandbox Code Playgroud)

也可以看看:

  • 谢谢您的回答!清理“/Library/Developer”文件夹为我解决了这个问题。 (2认同)
  • 您的前几个步骤对我的 14.0 beta 6 版有效。希望修复能够坚持下去。非常感谢。 (2认同)

Lin*_*nus 7

尝试删除然后重新添加您正在使用的一些文件。至少对我来说是这样。

这似乎是 Xcode 10.1 中的一个错误

  • 这仍然是 Xcode 12 中的错误吗?我遇到了同样的问题。 (2认同)

Lee*_*mur 7

我发现与启动图像相关的相同错误。

\n\n

我的解决方案:

\n\n

在主项目设置中转到:

\n\n
    \n
  1. 标签:常规
  2. \n
  3. 部分:应用程序图标和启动图像
  4. \n
  5. 选项:启动图像源
  6. \n
\n\n

删除资产目录的链接,并使用 CMD+SHIFT+K 清理构建文件夹。

\n\n

瞧\xc3\xa0!

\n\n

您可以稍后再次链接。

\n


Use*_*231 6

如果您更改从素材资源打开的图像之一,似乎会发生这种情况。以下是一些可行的解决方案:

  1. 其他模拟器上运行应用
  2. 清洁(CMD + SHIFT + K和CMD + ALT + SHIFT + K均)
  3. 将资产重新添加到项目中
  4. 重新启动 Mac
  5. 笑话:重启电厂


Vla*_*kyi 6

确保您的资产中有一个 AppIcon 文件。我有同样的错误,因为我确实删除了那个文件。

在此处输入图片说明