警告:复制捆绑资源构建阶段包含此目标的 Info.plist 文件 [英] Warning: The Copy Bundle Resources build phase contains this target's Info.plist file

查看:17
本文介绍了警告:复制捆绑资源构建阶段包含此目标的 Info.plist 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将一个项目分成了两个版本,并为每个版本提供了一个 plist 文件.一切正常,但我不断收到此构建警告:

I've separated a project into two builds and given each of them a plist file. Everything works fine, but I keep getting this build warning:

警告:复制捆绑资源构建阶段包含此目标的Info.plist 文件 'MyApp-Info.plist'

Warning: The Copy Bundle Resources build phase contains this target's Info.plist file 'MyApp-Info.plist'

当我尝试构建 MyApp 时,我得到了这个.为第二个目标构建会产生相同的错误(警告中带有 SecondTarget-Info.plist).我不知道为什么这是一个警告,因为我希望构建包含那个 .plist 文件.每个 .plist 文件都有一个目标成员资格(用于它们自己的构建).

I get this when I try to build MyApp. Building for the second target gives the same error (with SecondTarget-Info.plist in the warning). I'm not sure why it's a warning, since I want the build to contain that .plist file. Each of the .plist files have one target membership (for their own build).

这个警告是什么意思?有什么办法可以让它消失吗?

What does this warning mean? Is there any way to make it go away?

推荐答案

https://developer.apple.com/library/content/qa/qa1649/_index.html

摘录:

您收到此警告是因为您可能将 Info.plist 文件添加到复制捆绑资源构建阶段,如图所示

You are getting this warning because you probably added your Info.plist file to your Copy Bundle Resources build phase as shown in Figure

INFOPLIST_FILE 构建设置指定与目标关联的 Info.plist 的名称.构建目标时,Xcode 读取此构建设置并将引用的 Info.plist 复制到您的应用程序包中.由于 Xcode 会自动处理 Info.plist,因此您不应将其添加到复制捆绑资源构建阶段或使其成为目标成员.

The INFOPLIST_FILE build setting specifies the name of the Info.plist associated with your target. When building a target, Xcode reads this build setting and copies the referenced Info.plist into your application bundle. Because Xcode automatically processes the Info.plist, you should not add it to your Copy Bundle Resources build phase or make it a target member.

要解决此警告,请从 Copy Bundle Resource 构建阶段中选择您的 Info.plist,如图 1 所示,然后单击 Remove (-) 按钮将其从该阶段中删除.

To resolve this warning, select your Info.plist from the Copy Bundle Resource build phase as shown in Figure 1, then click the Remove (–) button to delete it from the phase.

这篇关于警告:复制捆绑资源构建阶段包含此目标的 Info.plist 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆