无法从Info.plist中读取 [英] Could not read from Info.plist
问题描述
我在2个mac之间复制了一个项目。我收到了有关在Xcode 4 ProcessInfoPlistFile中找不到Info.plist的错误消息:
I copied a project between 2 macs. I got the error message about Info.plist not found in Xcode 4 ProcessInfoPlistFile:
无法从
'/ Users读取数据/iamme/Documents/XCode/myapp/myapp/myapp-Info.plist':无法打开文件
myapp-Info.plist,因为没有这样的文件。
could not read data from '/Users/iamme/Documents/XCode/myapp/myapp/myapp-Info.plist': The file "myapp-Info.plist" couldn’t be opened because there is no such file.
根据 Xcode无法打开Info.plist - 错误说没有这样的文件我去构建设置并放置正确的路径 - 我复制了从Xcode中显示的文件路径粘贴。
As advised in Xcode can't open Info.plist -- error says "there is no such file" I went to build settings and put the right path - which I copied and pasted from file path shown in Xcode.
不幸的是,在编译时,我得到完全相同的消息。那么Info.plist路径还存储在哪里?
Unfortunately when compiling I got exactly the same message. So where else is Info.plist path stored?
更新:我已按照建议放置相对路径但仍然得到错误(在活动日志中提供完整消息):
Update: I have put relative path as advised but still get the error (give full message in activity log):
Process myapp/myapp-Info.plist
ProcessInfoPlistFile /Users/username/Library/Developer/Xcode/DerivedData/myapp-ancooijwpdbuzbbggnsalnhvckyr/Build/Products/Debug-iphonesimulator/myapp.app/Info.plist myapp/myapp-Info.plist
cd /Users/username/Documents/XCode/myapp
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"
builtin-infoPlistUtility myapp/myapp-Info.plist -genpkginfo /Users/username/Library/Developer/Xcode/DerivedData/myapp-ancooijwpdbuzbbggnsalnhvckyr/Build/Products/Debug-iphonesimulator/myapp.app/PkgInfo -expandbuildsettings -format binary -platform iphonesimulator -o /Users/username/Library/Developer/Xcode/DerivedData/myapp-ancooijwpdbuzbbggnsalnhvckyr/Build/Products/Debug-iphonesimulator/myapp.app/Info.plist
推荐答案
这里不要使用绝对路径,使用相对于项目文件的路径。
Don't use an absolute path here, use a path relative to your project file.
Xcode项目的默认布局是:
The default layout for Xcode projects is this:
CodeName.xcodeproj
CodeName/
CodeName-Info.plist
CodeName-Prefix.pch
图形上,在Finder中看起来像这样:
Graphically, that looks like this in Finder:
在这种情况下,您需要Info.plist文件 CodeName / CodeName-Info.plist 。
In this case, you'd want Info.plist File to be CodeName/CodeName-Info.plist.
在这里,我选择了Xcode项目,目标,并使用搜索栏来限制设置显示:
Here, I've selected the Xcode project, target, and used the search bar to limit the settings being shown:
最后,检查您的项目是否包含来自t的info.plist文件他是正确的位置。
Finally, check that your project is including the info.plist file from the right location.
这篇关于无法从Info.plist中读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!