在Xcode中构建项目时出现错误

18

构建项目时,我遇到了以下错误。

清理也没有帮助。突然间不知道出了什么问题。

CompileAssetCatalog /Users/Mayu/Library/Developer/Xcode/DerivedData/Pizza_to_Go-dohdzfdfbyycqrhirbysuinqfuzf/Build/Products/Debug-iphonesimulator/Pizza\ to\ Go.app Pizza\ to\ Go/Images.xcassets Pizza\ to\ Go/Images.xcassets
    cd "/Users/Mayu/Documents/development/git/pizzatogo/iPhoneApp/Pizza to Go"
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/actool --output-format human-readable-text --notices --warnings --export-dependency-info /Users/Mayu/Library/Developer/Xcode/DerivedData/Pizza_to_Go-dohdzfdfbyycqrhirbysuinqfuzf/Build/Intermediates/Pizza\ to\ Go.build/Debug-iphonesimulator/Pizza\ to\ Go.build/assetcatalog_dependencies.txt --output-partial-info-plist /Users/Mayu/Library/Developer/Xcode/DerivedData/Pizza_to_Go-dohdzfdfbyycqrhirbysuinqfuzf/Build/Intermediates/Pizza\ to\ Go.build/Debug-iphonesimulator/Pizza\ to\ Go.build/assetcatalog_generated_info.plist --app-icon AppIcon --launch-image LaunchImage --platform iphonesimulator --minimum-deployment-target 7.0 --target-device iphone --compress-pngs --compile /Users/Mayu/Library/Developer/Xcode/DerivedData/Pizza_to_Go-dohdzfdfbyycqrhirbysuinqfuzf/Build/Products/Debug-iphonesimulator/Pizza\ to\ Go.app /Users/Mayu/Documents/development/git/pizzatogo/iPhoneApp/Pizza\ to\ Go/Pizza\ to\ Go/Images.xcassets /Users/Mayu/Documents/development/git/pizzatogo/iPhoneApp/Pizza\ to\ Go/Pizza\ to\ Go/Images.xcassets

/* com.apple.actool.errors */
: error: There are multiple app icon set instances named "AppIcon".
: error: There are multiple launch image set instances named "LaunchImage".
/* com.apple.actool.compilation-results */
/Users/Mayu/Library/Developer/Xcode/DerivedData/Pizza_to_Go-dohdzfdfbyycqrhirbysuinqfuzf/Build/Products/Debug-iphonesimulator/Pizza to Go.app/Assets.car
/Users/Mayu/Library/Developer/Xcode/DerivedData/Pizza_to_Go-dohdzfdfbyycqrhirbysuinqfuzf/Build/Intermediates/Pizza to Go.build/Debug-iphonesimulator/Pizza to Go.build/assetcatalog_generated_info.plist
3个回答

22

根据这个错误提示,您有重复的图像 AppIcon 和 LaunchImage。为了解决这个问题,只需将其复制一份并从项目中删除它(在 Images.xcassets 中找到并删除)。之后再将其导入 Images.xcassets。


1
我不确定在哪里找到这些图片。我删除了 'images.xcassets' 并使用项目页面重新生成(从不使用 asset 目录的更改)。现在我有一个备份,但是首先在哪里可以找到那些要删除的图片呢? - Jay Mayu
我相信你已经删除了关于image.xcassets项目的引用。直接进入项目目录(finder),从那里复制它。然后通过Xcode将其删除并重新添加。 - Greg

4
对我而言,问题在于我的资产文件夹已经与多个目标相关联,而这些目标已经被分配了。解决方法是确保每个资产文件夹只分配给其特定的目标,或删除不需要的文件夹。

enter image description here


2
错误:在使用Storyboard时,出现了多个AppIcon实例。 解决方案: 在Storyboard窗口的导航面板中查找Images.xcassets的重复列表。如果存在,请将其选中并按删除键。当询问时,请选择“移除引用”而不是“发送到垃圾箱”(这可能会删除实际的Images.xcassets文件夹)。显然,如果尝试将某些内容导入Images.xcassetes失败,该项目中可能会出现此重复列表。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接