Xcode不能开放的信息。plist - error说“没有这样的文件”

时间:2022-01-19 00:57:57

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:

我切换到Xcode 4并加载了我的项目,它在Xcode 3中工作得非常好。当我运行它时,我得到一个错误,它说:

The file “Info.plist” couldn’t be opened because there is no such file.

“信息的文件。因为没有这样的文件,所以无法打开plist。

I have looked at the file in Xcode and it is there. So why can't it be opened?

我看过Xcode中的文件,它就在那里。为什么不能打开呢?

10 个解决方案

#1


130  

That the file exists in your Xcode project folder isn't enough. Have you verified the file is properly referenced in your application target's build settings so it's properly copied into the app bundle? It's not quite the same as a standard resource (ie, it's not made a member of the target in the set of target membership check boxes) but rather a build setting because of its importance in a properly-formatted bundle.

仅在Xcode项目文件夹中存在该文件是不够的。您是否验证了该文件在应用程序目标的构建设置中被正确引用,从而被正确地复制到应用程序包中?它与标准资源并不完全相同(例如,在目标成员资格复选框的集合中,它不是目标的成员),而是构建设置,因为它在适当格式的包中很重要。

Navigate to the project (select it in the Project navigator), select the application target in the list of targets, then click the Build Settings tab. Under the Packaging section, make sure the "Info.plist File" is properly set to the location/file name.

导航到项目(在项目导航器中选择它),在目标列表中选择应用程序目标,然后单击Build Settings选项卡。在包装部分,确保“信息”。“plist文件”被正确地设置为位置/文件名。

#2


15  

go to targets. right click on the test target. yourProjectTests and delete it

去的目标。右键单击测试目标。yourProjectTests和删除它

#3


10  

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". Xcode不能开放的信息。plist - error说“没有这样的文件”

对我来说,问题是有些。storyboard文件在合并后有不同的部署目标。通过设置所有故事板文件来使用“项目部署目标”来修复它。

#4


7  

Xcode 8

Xcode 8

Select the project file in the left pane. Then open the general tab and they have added a nice button that lets you select the file. (You may have to add it into your project structure as well)

选择左边窗格中的项目文件。然后打开general选项卡,他们添加了一个漂亮的按钮,允许您选择文件。(您可能还需要将其添加到项目结构中)

Xcode不能开放的信息。plist - error说“没有这样的文件”

#5


5  

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

对我来说,这是由于启用了plist文件的本地化(在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.

在目标>设置> >包装信息建设。我将路径从AppName/AppName-info更改为plist文件键。plist浏览器名称/ lproj / AppName-info。plist和所有东西都按预期工作。

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

记住,它的lproj是一个小L而不是大写I。

Hope this helps.

希望这个有帮助。

#6


1  

under Xcode 4.6 if the appname-Info.plist is not visible under project -> target/info, go to summary tab and it will ask for the appname-Info.plist file. Select the correct file from the suggestion(s).

在Xcode 4.6下,如果是appname-Info。plist在project -> target/info下不可见,转到summary选项卡,它会要求appname-Info。plist文件。从建议中选择正确的文件。

#7


1  

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

在目标> >包装信息。plist文件,确保文件路径是正确的。

#8


0  

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.

在我的情况下,文件在那里,但格式不正确。如果你最近编辑了你的信息。在文本编辑器中,撤销该更改,并在不破坏标记有效性的情况下重试。

#9


0  

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.

对我来说,问题是错误指向了信息。我使用的库中的plist,而不是项目中实际的.plist文件。

Maybe this will help someone in the future.

也许这对未来的人有帮助。

#10


0  

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

在我的例子中,在添加ATS遵从标志时漏掉了一个关键字

<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

虽然一些在线XML验证器确实说XML是正确的(不是),但是我使用了

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://*.com/a/32494850/5438240)

进入plist文件所在的目录(从终端),并知道有问题引用的确切行号:(https://*.com/a/32494850/5438240)

#1


130  

That the file exists in your Xcode project folder isn't enough. Have you verified the file is properly referenced in your application target's build settings so it's properly copied into the app bundle? It's not quite the same as a standard resource (ie, it's not made a member of the target in the set of target membership check boxes) but rather a build setting because of its importance in a properly-formatted bundle.

仅在Xcode项目文件夹中存在该文件是不够的。您是否验证了该文件在应用程序目标的构建设置中被正确引用,从而被正确地复制到应用程序包中?它与标准资源并不完全相同(例如,在目标成员资格复选框的集合中,它不是目标的成员),而是构建设置,因为它在适当格式的包中很重要。

Navigate to the project (select it in the Project navigator), select the application target in the list of targets, then click the Build Settings tab. Under the Packaging section, make sure the "Info.plist File" is properly set to the location/file name.

导航到项目(在项目导航器中选择它),在目标列表中选择应用程序目标,然后单击Build Settings选项卡。在包装部分,确保“信息”。“plist文件”被正确地设置为位置/文件名。

#2


15  

go to targets. right click on the test target. yourProjectTests and delete it

去的目标。右键单击测试目标。yourProjectTests和删除它

#3


10  

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". Xcode不能开放的信息。plist - error说“没有这样的文件”

对我来说,问题是有些。storyboard文件在合并后有不同的部署目标。通过设置所有故事板文件来使用“项目部署目标”来修复它。

#4


7  

Xcode 8

Xcode 8

Select the project file in the left pane. Then open the general tab and they have added a nice button that lets you select the file. (You may have to add it into your project structure as well)

选择左边窗格中的项目文件。然后打开general选项卡,他们添加了一个漂亮的按钮,允许您选择文件。(您可能还需要将其添加到项目结构中)

Xcode不能开放的信息。plist - error说“没有这样的文件”

#5


5  

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

对我来说,这是由于启用了plist文件的本地化(在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.

在目标>设置> >包装信息建设。我将路径从AppName/AppName-info更改为plist文件键。plist浏览器名称/ lproj / AppName-info。plist和所有东西都按预期工作。

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

记住,它的lproj是一个小L而不是大写I。

Hope this helps.

希望这个有帮助。

#6


1  

under Xcode 4.6 if the appname-Info.plist is not visible under project -> target/info, go to summary tab and it will ask for the appname-Info.plist file. Select the correct file from the suggestion(s).

在Xcode 4.6下,如果是appname-Info。plist在project -> target/info下不可见,转到summary选项卡,它会要求appname-Info。plist文件。从建议中选择正确的文件。

#7


1  

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

在目标> >包装信息。plist文件,确保文件路径是正确的。

#8


0  

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.

在我的情况下,文件在那里,但格式不正确。如果你最近编辑了你的信息。在文本编辑器中,撤销该更改,并在不破坏标记有效性的情况下重试。

#9


0  

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.

对我来说,问题是错误指向了信息。我使用的库中的plist,而不是项目中实际的.plist文件。

Maybe this will help someone in the future.

也许这对未来的人有帮助。

#10


0  

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

在我的例子中,在添加ATS遵从标志时漏掉了一个关键字

<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

虽然一些在线XML验证器确实说XML是正确的(不是),但是我使用了

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://*.com/a/32494850/5438240)

进入plist文件所在的目录(从终端),并知道有问题引用的确切行号:(https://*.com/a/32494850/5438240)