在 Xcode 中构建项目时出错
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20562755/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error when building the project in Xcode
提问by Jay Mayu
I get following error while building the project.
构建项目时出现以下错误。
Clening also didn't help. No idea what went wrong all of a sudden
克莱宁也没有帮助。突然不知道出了什么问题
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
回答by Greg
As this error says you have duplicated images AppIcon and LaunchImage. To sort it just make copy of it and remove it from your project (have a look in Images.xcassets and remove it as well). After that import it again to Images.xcassets.
由于此错误表明您有重复的图像 AppIcon 和 LaunchImage。要对其进行排序,只需复制它并将其从您的项目中删除(查看 Images.xcassets 并将其删除)。之后再次将其导入到 Images.xcassets。
回答by Andy
For me, the problem was that I had my assets folder with multiple targets with while extensions already had those target assigned. Fix was to make sure each asset folder was only assigned to its specific target, or delete folders that are not needed.
对我来说,问题是我的资产文件夹有多个目标,而扩展已经分配了这些目标。修复是确保每个资产文件夹仅分配给其特定目标,或删除不需要的文件夹。
回答by Deepspringer
Error:multiple instances of AppIcon (when working with Storyboard).
错误:AppIcon 的多个实例(使用 Storyboard 时)。
This solution worked for me:
这个解决方案对我有用:
Look in the Storyboard window's Navigation panel for a duplicate listing of Images.xcassets. If there, highlight it and press delete key. When asked, select “remove reference” - not send to trash (which might delete the actual Images.xcassets folder). Apparently this duplicate listing in the project can occur if an attempt is aborted to import something into Images.xcassetes.
在 Storyboard 窗口的导航面板中查看 Images.xcassets 的重复列表。如果有,突出显示它并按删除键。当被问到时,选择“删除引用” - 不发送到垃圾箱(这可能会删除实际的 Images.xcassets 文件夹)。显然,如果尝试将某些内容导入到 Images.xcassetes 中的尝试被中止,则项目中可能会出现此重复列表。