Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
797 views
in Technique[技术] by (71.8m points)

iphone - Could not read from Info.plist

I copied a project between 2 macs. I got the error message about Info.plist not found in Xcode 4 ProcessInfoPlistFile:

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.

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.

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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Don't use an absolute path here, use a path relative to your project file.

The default layout for Xcode projects is this:

CodeName.xcodeproj
CodeName/
    CodeName-Info.plist
    CodeName-Prefix.pch

Graphically, that looks like this in Finder: Project Layout in Finder

In this case, you'd want Info.plist File to be CodeName/CodeName-Info.plist.

Here, I've selected the Xcode project, target, and used the search bar to limit the settings being shown:

Info.plist setting

Finally, check that your project is including the info.plist file from the right location.

Info.plist location


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...