xcode 无效的图像路径 - 在键 'CFBundleIcons':'AppIcon20x20' 下引用的路径中找不到图像

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43584157/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:55:59  来源:igfitidea点击:

Invalid Image Path - No image found at the path referenced under key 'CFBundleIcons':'AppIcon20x20'

iosswiftxcode

提问by David Long

REPOSTING SINCE I AM GETTING NO ANSWERS ON THIS.

重新发布,因为我对此没有答案。

I have been struggling with this issue for over a week. Whenever I try to validate a build or use application loader lately I have been getting this error:

我已经为这个问题苦苦挣扎了一个多星期。每当我最近尝试验证构建或使用应用程序加载器时,我都会收到此错误:

iTunes Store operation failed. 
Invalid Image Path - No image found at the path referenced under key 'CFBundleIcons':'AppIcon20x20'

Now, the problem is there is no AppIcon20x20 key in my plist.

现在,问题是我的 plist 中没有 AppIcon20x20 键。

Here's my AppIcon asset and attributes settings: AppIcon, Attributes

这是我的 AppIcon 资产和属性设置: AppIcon, Attributes

Nowhere is a 20x20 asset even mentioned in my Plist, as seen by the source code version here :

甚至在我的 Plist 中都没有提到 20x20 资产,如此处的源代码版本所示:

    <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleIcons</key>
    <dict>
        <key>CFBundlePrimaryIcon</key>
        <dict>
            <key>CFBundleIconFiles</key>
            <array>
                <string>icon603x.png</string>
                <string>icon602x.png</string>
                <string>icon403x.png</string>
                <string>icon402x.png</string>
                <string>icon293x.png</string>
                <string>icon292x.png</string>
                <string>icon203x.png</string>
                <string>icon203x.png</string>
            </array>
        </dict>
    </dict>
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
        <key>NSExceptionDomains</key>
        <dict>
            <key>https://millsfitnessapparel.myshopify.com/</key>
            <string></string>
        </dict>
    </dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleVersion</key>
    <string>1</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
</dict>
</plist>

And lastly, I have googled the heck out of this topic and they all say to just add CFBundleIcons to your plist, which I did, but it's still throwing the error. I have also done this in versions of this project where there are pods, no pods, workspaces, regular xcproj. files, and even with 1 view controller and just some icons [this latest build].

最后,我用谷歌搜索了这个话题,他们都说只需将 CFBundleIcons 添加到你的 plist 中,我做到了,但它仍然抛出错误。我也在这个项目的版本中完成了这个,其中有 Pod、没有 Pod、工作区、常规 xcproj。文件,甚至有 1 个视图控制器和一些图标 [最新版本]。

I have also tried to achive this build in xcode versions 8.1, 8.2, and 8.3, all receiving the same error.

我还尝试在 xcode 版本 8.1、8.2 和 8.3 中实现此构建,但都收到相同的错误。

Any help here would be greatly appreciated. These are apps for a client and I am currently late on delivering because of this issue. Thanks.

这里的任何帮助将不胜感激。这些是针对客户的应用程序,由于这个问题,我目前无法交付。谢谢。

回答by Febin Fathah

you can simply create your app icons asset using https://makeappicon.com/. You have to supply a 1536x1536px image for the best result. It will automatically create all the app icons for your project

您可以简单地使用https://makeappicon.com/创建您的应用程序图标资产。您必须提供 1536x1536 像素的图像以获得最佳效果。它将自动为您的项目创建所有应用程序图标

Also please refer to the following:-

另请参阅以下内容:-

  • Check the icon file's name is exactly same as the name in your info.plist. It's fine while running debug mode though, It doesn't work while you upload/ validate the build.

  • Please check your app's bundle identifier is correct.

  • 检查图标文件的名称是否与 info.plist 中的名称完全相同。不过在运行调试模式时很好,但在您上传/验证构建时它不起作用。

  • 请检查您的应用程序包标识符是否正确。