xcode 这个目标可能包括它自己的产品
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10448589/
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
This target might include its own product
提问by Banshi
File .../FaceDeFace.app depends on itself.
This target might include its own product.File .../FaceDeFace.app depends on itself.
This target might include its own product.
文件 .../FaceDeFace.app 取决于自身。
这个目标可能包括它自己的产品。文件 .../FaceDeFace.app 取决于自身。
这个目标可能包括它自己的产品。
I have done my project in os Snow leopard but now my os version also changed and it is now 10.7.3. This is installed in my Imac machine. This app start first in MacBook but now I want to develop it in IMac. But the above error is shown so what i have to do. Though I have change all of my certificate, and all provisioning profiles newly. Please help. Thanks i advance.
我已经在 os Snow leopard 中完成了我的项目,但现在我的 os 版本也发生了变化,现在是 10.7.3。它安装在我的 Imac 机器上。这个应用程序首先在 MacBook 中启动,但现在我想在 IMac 中开发它。但是显示了上面的错误,所以我必须做什么。尽管我已经更改了所有证书和所有配置文件。请帮忙。谢谢我提前。
回答by Caleb
Select the target in your Xcode project and click the Build Phases tab. Look at the Target Dependencies list; the target's product should notbe listed there, but it sounds like it may have been added to that list by mistake. Also check the other areas in that same tab -- you don't want your product listed in Copy Bundle Resources or Link Binary With Libraries, either -- you obviously can't use the thing that you're building as a resource or library to build the product in the first place. That's what Xcode seems to be complaining about.
在 Xcode 项目中选择目标,然后单击 Build Phases 选项卡。查看目标依赖项列表;目标的产品不应该在那里列出,但听起来它可能被错误地添加到该列表中。还要检查同一选项卡中的其他区域——您也不希望将您的产品列在 Copy Bundle Resources 或 Link Binary With Libraries 中——您显然不能将正在构建的东西用作资源或库首先构建产品。这就是 Xcode 似乎在抱怨的地方。
回答by smileyborg
Ran across this issue using Xcode 7 (beta 1) when trying to build a Static Library target. Here was the error message from the build output:
在尝试构建静态库目标时,使用 Xcode 7 (beta 1) 遇到了这个问题。这是来自构建输出的错误消息:
Unable to run command 'CopySwiftLibs libMyStaticLibraryName.a' - this target might include its own product.
无法运行命令“CopySwiftLibs libMyStaticLibraryName.a” - 此目标可能包含其自己的产品。
(I substituted libMyStaticLibraryName.a
above in place of the actual name of my static library.)
(我libMyStaticLibraryName.a
在上面替换了我的静态库的实际名称。)
The problem turned out to be that this static library target had the Embedded Content Contains Swift Codebuild setting (EMBEDDED_CONTENT_CONTAINS_SWIFT
) set to YES, when in reality there was no Swift code associated with this target. Setting this to NO in Xcode fixed the issue.
问题原来是这个静态库目标的嵌入内容包含 Swift 代码构建设置 ( EMBEDDED_CONTENT_CONTAINS_SWIFT
) 设置为 YES,而实际上没有与此目标关联的 Swift 代码。在 Xcode 中将其设置为 NO 解决了这个问题。
Static libraries cannot include Swift code, so if this build setting is set it causes the error, even if there is no actual Swift code in the target.
静态库不能包含 Swift 代码,因此如果设置了此构建设置,则会导致错误,即使目标中没有实际的 Swift 代码。
回答by Tran Trung Hieu
In my case, very simple, please delete Universal target, then add new target. That's all
就我而言,非常简单,请删除通用目标,然后添加新目标。就这样
回答by Stacy Smith
In my case my project had submoduleinside, so commands
git submodule add submoduleURL
git submodule init
git submodule update
在我的情况下,我的项目里面有子模块,所以命令
git submodule add submoduleURL
git submodule init
git submodule update
solved this issue.
解决了这个问题。
回答by Denis Kutlubaev
I had the same problem, when podspec
file was incorrect. My mistake was that I didn't specify .h
and .m
extensions for source_files
. Because of that .xib
files were added twice. This is a correct example:
当podspec
文件不正确时,我遇到了同样的问题。我的错误是,我没有具体说明.h
,并.m
进行功能扩展source_files
。因为那个.xib
文件被添加了两次。这是一个正确的例子:
s.source_files = 'YourTarget/Classes/**/*.{h,m}'
s.resources = ['YourTarget/Classes/UIComponents/**/*.xib']
See https://guides.cocoapods.org/syntax/podspec.html#source_files
见https://guides.cocoapods.org/syntax/podspec.html#source_files