无法从Info.plist中读取
我在2个mac之间复制了一个项目。我得到的Info.plist错误消息在Xcode 4 ProcessInfoPlistFile未发现:无法从Info.plist中读取
无法读取 “/Users/iamme/Documents/XCode/myapp/myapp/myapp-Info.plist”的数据:该文件 “myapp-Info.plist”无法打开,因为没有这样的文件。
如Xcode can't open Info.plist -- error says "there is no such file"劝我去构建设置,并把正确的道路 - 这是我复制并从Xcode中所示的文件路径粘贴。
不幸的是编译时我得到了完全相同的信息。那么Info.plist路径存储在哪里?
更新:我已经把作为建议,但仍然得到错误的相对路径(充分的消息中活动日志):
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
这里不要使用绝对路径,使用路径相对于项目文件。
的Xcode的项目的默认布局是这样的:
CodeName.xcodeproj
CodeName/
CodeName-Info.plist
CodeName-Prefix.pch
图形,看起来像这样在Finder中:
在这种情况下,你会希望Info.plist文件是CodeName/CodeName-Info.plist。
这里,我选择了Xcode项目,目标,以及所使用的搜索栏,以限制设置被显示:
最后,检查您的项目包括Info.plist文件从正确的位置。
选择项目目标去构建阶段,然后选择“复制包资源”,你会看到红色突出显示的文件引用只是删除这些引用,再次添加所有这些文件。现在执行清理和构建。
为了安全检查,只需在“Build Settings”>“Packaging”部分验证Info.plist文件路径即可。
警告:切勿在iOS项目的“复制包资源”构建阶段添加Info.plist。
谢谢我把相对路径,但仍有问题,请参阅我的更新。 – user310291 2012-03-27 00:33:57
您错过了错误部分的日志。 :) – 2012-03-27 00:41:46
哦,你的意思是同样的错误?那么,另一件事可能是Info.plist的相对路径。这是在支持文件。我会相应地更新答案。 – 2012-03-27 00:56:06