XCode:“警告:输出文件的多个构建命令”但如果我删除重复项,则会出错
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17121371/
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
XCode: 'Warning: Multiple build commands for output file' but I get error if I delete the duplicate
提问by MeltingDog
I get the errors:
我收到错误:
Warning: Multiple build commands for output file /Users/me/Library/Developer/Xcode/DerivedData/myapp-csoyvdzaugzkszeagjrtzrfssudr/Build/Products/Debug-iphonesimulator/myapp.app/icon-72.png
Warning: Multiple build commands for output file /Users/me/Library/Developer/Xcode/DerivedData/myapp-csoyvdzaugzkszeagjrtzrfssudr/Build/Products/Debug-iphonesimulator/myapp.app/Default-Landscape@2x~ipad.png
Warning: Multiple build commands for output file /Users/me/Library/Developer/Xcode/DerivedData/myapp-csoyvdzaugzkszeagjrtzrfssudr/Build/Products/Debug-iphonesimulator/myapp.app/Default-Landscape~ipad.png
When I try to run my app in the simulator. I understand this is because of duplicate files. But when I remove either of the duplicates I get the errors:
当我尝试在模拟器中运行我的应用程序时。我知道这是因为文件重复。但是当我删除任何一个重复项时,我会收到错误消息:
error: /Users/me/Documents/Cordova27/myapp/myapp/Resources/icons/icon-72.png: No such file or directory
Does anyone know how to fix this at all? Have tried cleaning and restarting XCode to no avail.
有谁知道如何解决这个问题?尝试清理并重新启动 XCode 无济于事。
回答by MackC
open the Copy Bundle Resources
Build Phase. find the twice files in that list and Delete the duplicate reference.
打开Copy Bundle Resources
构建阶段。找到该列表中的两次文件并删除重复的引用。
回答by Raja Rao
I moved bunch of images to a different folders and hit the same issue. To solve, basically go to build phases >> Copy Bundle Resourcesand remove earlier references as shown in the picture below. Note: Another thing to check is to see if you have multiple references of the files in the left panel (you will see 2 files with the same name)
我将一堆图像移动到不同的文件夹并遇到了同样的问题。要解决这个问题,基本上去构建阶段>>复制捆绑资源并删除之前的引用,如下图所示。注意:要检查的另一件事是查看左侧面板中是否有多个文件引用(您将看到 2 个具有相同名称的文件)
回答by Lithu T.V
Remove both,Add again.[Drag and drop at the icon field in the summary page]
两者都去掉,重新添加。[在摘要页面的图标字段处拖放]
回答by danypata
If you set the splash/launch icon from Xcode (Targets -> Summary ...), the Xcode has an annoying feature that will copy your png file into the root folder, and after that you will get the warning for "Multiple build commands". What you need to do is, delete your png file used for splash/launch and also check the copy bundle resources
in Target
section and make sure your file has been removed from there. It will appear in red if the file is removed from your project and not removed from Copy bundle resources
.
如果您从 Xcode(目标 -> 摘要 ...)设置启动/启动图标,Xcode 有一个烦人的功能,会将您的 png 文件复制到根文件夹中,然后您将收到“多个构建命令”的警告”。您需要做的是,删除用于启动/启动的 png 文件,并检查copy bundle resources
inTarget
部分并确保您的文件已从那里删除。如果文件已从您的项目中删除而不是从Copy bundle resources
.
回答by dip
回答by Dan Loughney
My problem was also in Copy Bundle Resources, but my cause was fast lane. All of my fastlane files name.txt, keywords.txt, marketing.txt, etc. were copied from each of my support languages into the bundle.
我的问题也出在 Copy Bundle Resources 中,但我的原因是快车道。我所有的 fastlane 文件 name.txt、keywords.txt、marketing.txt 等都从我的每种支持语言复制到包中。
Go to your target Build Settings. In the search tool, enter the name of each fastlane file. In this case, you can delete all fastlane files. These are used for uploading your bundle to the App Store and so the files don't need to be in the bundle at all.
转到您的目标构建设置。在搜索工具中,输入每个 fastlane 文件的名称。在这种情况下,您可以删除所有 fastlane 文件。这些用于将您的捆绑包上传到 App Store,因此文件根本不需要在捆绑包中。