Xcode can't open Info.plist — error says “there is no such file”

前端 未结 12 1243
悲&欢浪女
悲&欢浪女 2020-12-13 08:16

I switched to Xcode 4 and loaded my project, which worked perfectly in Xcode 3. When I run it, I get an error that says:

The file “Info.plist” couldn’

相关标签:
12条回答
  • 2020-12-13 08:49

    For me the issue was that the error was referring to the Info.plist from a library I was using, not the actual .plist file from the project.

    Maybe this will help someone in the future.

    0 讨论(0)
  • 2020-12-13 08:51

    For me the problem was that some of the .storyboard files had different deployment targets after a merge. Fixed it by setting all the storyboard files to use "Project Deployment Target".

    0 讨论(0)
  • 2020-12-13 08:54

    In my case one of the key was missed out while adding ATS compliance flag

    <key>NSAppTransportSecurity</key>
    

    Instead of the correct one as below

    <true/>
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoadsInWebContent</key>
        <true/>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
        <key>NSExceptionDomains</key>
        <dict>
            <key>some-service1.com</key>
            <dict>
                <key>NSExceptionAllowsInsecureHTTPLoads</key>
                <false/>
            </dict>
            <key>some-service2.com</key>
            <dict>
                <key>NSExceptionAllowsInsecureHTTPLoads</key>
                <false/>
            </dict>
        </dict>
    </dict>
    

    I was having this

    <dict>
        <key>NSAllowsArbitraryLoadsInWebContent</key>
        <true/>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
        <key>NSExceptionDomains</key>
        <dict>
            <key>some-service1.com</key>
            <dict>
                <key>NSExceptionAllowsInsecureHTTPLoads</key>
                <false/>
            </dict>
            <key>some-service2.com</key>
            <dict>
                <key>NSExceptionAllowsInsecureHTTPLoads</key>
                <false/>
            </dict>
        </dict>
    </dict>
    

    Although some of the online XML Validators did say the XMLs are correct, (which was not), I used

    plutil filename.plist
    

    going to the directory where plist file is present (from terminal) and got to know the exact line number that had issues Reference :(https://stackoverflow.com/a/32494850/5438240)

    0 讨论(0)
  • 2020-12-13 08:57

    In my case, the file was there, but malformed. If you recently edited your Info.plist in a text editor, undo that change, and retry without breaking the markup validity.

    0 讨论(0)
  • 2020-12-13 08:58

    For me this happened as a result of enabling localization of the plist file (to give language specific identifier of the app on springboard).

    In targets>build settings>packaging>info.plist file key i changed the path from AppName/AppName-info.plist to AppName/Base.lproj/AppName-info.plist and everything worked as expected.

    Remember, its lproj as in a small L and not a capital I.

    Hope this helps.

    0 讨论(0)
  • 2020-12-13 09:01

    Under Targets>Packaging>Info.plist file, make sure that the file path is correct.

    0 讨论(0)
提交回复
热议问题