Xcode 构建时错误:'无法加载文件列表的内容:'.../Info.plist'(在目标 'xxxx' 中)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/55011171/
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 Buildtime Error: 'Unable to load contents of file list: '.../Info.plist' (in target 'xxxx')
提问by stephenspann
Xcode started throwing this error in a project today, and I'm having trouble figuring out what it means and how to troubleshoot it, and it's not coming up in any searches. It happens immediately after trying to build to a device (no scripts compile, etc):
Xcode 今天开始在一个项目中抛出这个错误,我无法弄清楚它的含义以及如何解决它,而且它没有出现在任何搜索中。它在尝试构建到设备后立即发生(没有脚本编译等):
error: Unable to load contents of file list: '/Users/.../Products/Debug-appletvos/myapp.app/Info.plist' (in target 'myapp')
错误:无法加载文件列表的内容:“/Users/.../Products/Debug-appletvos/myapp.app/Info.plist”(在目标“myapp”中)
Full log below, (note I've replaced build folder with ... for brevity)
下面的完整日志,(注意我已经用 ... 替换了 build 文件夹为简洁起见)
Showing Recent Messages
Prepare build
note: Using new build systemnote: Planning buildnote: Constructing build description
Build system information
error: Unable to load contents of file list: '/Users/.../Products/Debug-appletvos/myapp.app/Info.plist' (in target 'myapp')
Build failed 3/5/19, 3:09 PM 0.2 seconds
Things I've tried so far:
到目前为止我尝试过的事情:
- Restarting Xcode
- Restarting Computer
- 'Product' > 'Clean Build Folder'
- Manually deleting everything in Build folder
- Re-download repository on the same computer (same issue)
- Re-download repository on a different computer (same issue)
- reverting to a previous commit that was working (same issue)
plutil Info.plist
responds withInfo.plist: OK
- 重启Xcode
- 重启电脑
- “产品”>“清理构建文件夹”
- 手动删除 Build 文件夹中的所有内容
- 在同一台计算机上重新下载存储库(相同的问题)
- 在另一台计算机上重新下载存储库(相同问题)
- 恢复到先前有效的提交(相同问题)
plutil Info.plist
回应Info.plist: OK
Other items of note:
其他注意事项:
- Project uses Cocoapods
- Project utilizes custom C++ code
- The only file list in the
Info.plist
file is a list of 2 custom fonts, but those are showing up ok in the Xcode project browser (not red).
- 项目使用 Cocoapods
- 项目使用自定义 C++ 代码
- 文件中唯一的文件列表
Info.plist
是 2 种自定义字体的列表,但它们在 Xcode 项目浏览器中显示正常(不是红色)。
If anyone has encountered this before and has a fix, or has any other suggestions for troubleshooting I would greatly appreciate it, thanks!
如果有人之前遇到过这个问题并得到了修复,或者有任何其他故障排除建议,我将不胜感激,谢谢!
回答by Tr?n Trung Hi?u
In my case, I just fixed below
就我而言,我只是在下面修复
- Open terminal under project folder
pod deintegrate
sudo gem install cocoapods-clean
pod clean
- Open the project and delete (if it's still there) the “Pods” folder that should be red
pod setup
(This may take some time)pod install
- 在项目文件夹下打开终端
pod deintegrate
sudo gem install cocoapods-clean
pod clean
- 打开项目并删除(如果它仍然存在)应该是红色的“Pods”文件夹
pod setup
(这可能要花点时间)pod install
回答by kalafun
I realised after a while that my colleague has updated cocoapods to the latest version, so what I did was just
过了一会儿,我意识到我的同事已经将 cocoapods 更新到了最新版本,所以我所做的只是
sudo gem install cocoapods
And that did the trick! :)
这就是诀窍!:)
回答by Randall Wang
I fix this in this way:
我以这种方式解决这个问题:
1、Go to your project's target, -> Build Phases -> Embed Pods Frameworks
1、进入你的项目目标,-> Build Phases -> Embed Pods Frameworks
2、check the input files and input file lists, Output files, and output file lists.
2、检查输入文件和输入文件列表、输出文件和输出文件列表。
3、move dir from input file lists to input files, and output file lists to output files
3、将dir从输入文件列表移到输入文件,将输出文件列表移到输出文件
回答by stephenspann
Finally figured this out, posting here so others googling can find it.
终于想通了,在这里发布,以便其他谷歌搜索可以找到它。
It was an issue with a build script that used the 'Input File Lists' option, removing and re-adding the script fixed the issue.
这是使用“输入文件列表”选项的构建脚本的问题,删除并重新添加脚本修复了该问题。
- Nav to Target
- 'Build Phases' tab
- 'Run Script' phase
- make notes of what's there, remove it
- re-run to make sure things work
- re-add the script (and content under 'Input File Lists')
- 导航到目标
- “构建阶段”选项卡
- “运行脚本”阶段
- 记下那里的内容,将其删除
- 重新运行以确保一切正常
- 重新添加脚本(以及“输入文件列表”下的内容)
回答by Erumaru
The problem is that you have added path to Input File Lists
instead of Input Files
问题是您添加了路径Input File Lists
而不是Input Files
回答by Moiz Irshad
In my case, I just fixed below
就我而言,我只是在下面修复
1- Go to your project's target, -> Build Phases -> Delete [CP] Copy Pods Resources.
2- pod deintegrate
.
3- pod install
.
1- 转到您项目的目标,-> Build Phases -> Delete [CP] Copy Pods Resources。2- pod deintegrate
。3- pod install
。
回答by Alexander Kuzyaev
In my case, the problem wasn't about cocoapods, it was about Fabric
就我而言,问题不在于可可豆,而在于 Fabric
I removed row $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
from Build Phases > Fabric > Input File Lists
and it fixed the error
我删除行$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
从Build Phases > Fabric > Input File Lists
它固定的错误