ios - 配置 Gluon Mobile 插件以使用 ios Assets 目录

标签 ios gluon-mobile

如何配置 Gluon Mobile 以使用 iOS Assets 目录?根据此链接:https://developer.apple.com/ios/submit/ :“从 2018 年 4 月开始,所有提交到 App Store 的新 iOS 应用程序都必须使用 iOS 11 SDK 构建。”,我认为这意味着必须使用 Assets 目录。

我的 ipa - 文件上传没有错误,但随后我通过邮件收到了 htis 消息:

“尊敬的开发者,

我们在您的应用“”的最近交付中发现了一个或多个问题。请更正以下问题,然后重新上传。

缺少 Assets 目录 - 您的应用程序在“....app”中缺少 Assets 目录文件。有关详细信息,请参阅 http://help.apple.com/xcode/mac/current/#/dev10510b1f7

Gluon 的哪个示例项目在这方面是最新的?

最佳答案

与此同时,我设法提交到 iTunes。方法如下:

创建文件夹 <your-catalog-name>.xcassets (典型默认值为 Assets.xcassets )位于 src/ios/assets .此文件夹的内容必须符合 iOS SDK 11 Assets 目录格式,因此称为“ Assets 目录文件夹”。最好使用 XCode(参见 https://developer.apple.com/library/content/documentation/Xcode/Reference/xcode_ref-Asset_Catalog_Format/FolderStructure.html)创建它,然后使用 Mac OS Finder 将生成的文件系统文件夹复制粘贴到您的 Gluon Mobile 项目中。

提示:注意不要混淆 Asset 目录文件夹 和位于其中的 Asset 文件夹

我的 Intellij 项目的屏幕截图,其中包含两个 Assets 文件夹,AppIcon.appiconsetLaunchImage.launchimage :

enter image description here

注意 Contents.json每个 Assets 文件夹中的文件。一旦由 XCode 创建,我不建议您手动更改任何内容,除非您确切地知道自己在做什么。

然后使用 Info.plist 中的条目引用 Asset 文件夹,如下所示:

<?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>
        ...

        <!-- The name "AppIcon" refers to the asset folder name of type "appiconset",
             that is the first part of the folder name "AppIcon.appiconset".
             This folder is located inside the asset catalog "Assets.xcassets",
             which in turn is located in the project folder "src/ios/assets".
        -->
        <key>CFBundleIconName</key>
        <string>AppIcon</string>


        ...

 </dict>
</plist>

请注意,有不同类型的 Assets 文件夹。除了“...appiconset” Assets 文件夹,您还需要一个 ...launchimage文件夹,但这一切都可以根据上面的链接使用 XCode 轻松创建。另见 https://developer.apple.com/library/content/documentation/Xcode/Reference/xcode_ref-Asset_Catalog_Format/AssetTypes.html#//apple_ref/doc/uid/TP40015170-CH30-SW1

我首先对配置 iOS 应用程序图标的各种旧版本感到困惑,例如来自 https://github.com/gluonhq/gluon-samples/blob/master/notes/src/ios/Default-Info.plist :

不要使用旧格式!

<key>CFBundleIconFiles</key>
        <array>
                <string>Icon-60</string>
                <string>Icon-76</string>
                <string>Icon-Small-40</string>
                <string>Icon-Small</string>
        </array>
        <key>CFBundleIconFiles~ipad</key>
        <array>
                <string>Icon-76</string>
                <string>Icon-Small-40</string>
                <string>Icon-Small</string>
</array>

这也是一种旧格式,请勿使用!

<key>CFBundleIcons</key>
    <dict>
        <key>CFBundlePrimaryIcon</key>
        <dict>
            <key>CFBundleIconFiles</key>
            <array>
                <string>Icon</string>
                <string>Icon-72</string>
                <string>Icon-120</string>
                ...
            </array>
        </dict>
    </dict>

最后,我包含了帮助我弄清楚所有这些的链接:

https://medium.com/@hellosunschein/launchimage-s-explained-33b88c02d027

https://github.com/MobiVM/robovm/issues/210

关于ios - 配置 Gluon Mobile 插件以使用 ios Assets 目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49357383/

相关文章:

html - 有没有办法制作一个适用于 iOS 的播放器,可以在 HTML 文档中播放,而不是全屏播放?

iphone - 是否可以检查用户在iOS 5的内置Twitter应用程序中是否具有Twitter帐户?

iphone - 以编程方式将 UITableView 行从一个位置移动/动画化到另一个位置

java - 有一种方法可以在 javafx 移动设备上更改文本选择句柄光标样式吗?

ios - JavaFXPorts - 移动设备上的滚动条问题

ios - 使用swift访问解析中的类

ios - 如何使用 [[UIApplication sharedApplication] openURL :] from a foreground app 打开一个新应用程序

java - StorageService 在 GluonHQ 框架上出现错误 - 如何解决此问题?

java - 关于android文件管理、Android环境概念和android库插件