如何将Gluon Mobile配置为使用iOS资产目录?根据此链接:https://developer.apple.com/ios/submit/:"从2018年4月开始,提交到App Store的所有新iOS应用都必须使用iOS 11 SDK构建。",我认为这意味着使用资产目录是强制性的。
我的ipa - 文件上传没有错误,但后来我通过邮件收到了htis消息:
"亲爱的开发者,
我们确定了您的应用最近投放的一个或多个问题,""。请更正以下问题,然后重新上传。
缺少资产目录 - 您的应用在' .... app'中缺少资产目录文件。有关详细信息,请参阅http://help.apple.com/xcode/mac/current/#/dev10510b1f7。"
Gluon的哪个样本项目在这方面是最新的?
答案 0 :(得分:1)
与此同时,我设法提交给iTunes。方法如下:
创建位于<your-catalog-name>.xcassets
的文件夹Assets.xcassets
(典型默认值为src/ios/assets
)。此文件夹的内容必须与iOS SDK 11资产目录格式匹配,因此称为“资产目录文件夹”。最好使用XCode创建(参见https://developer.apple.com/library/content/documentation/Xcode/Reference/xcode_ref-Asset_Catalog_Format/FolderStructure.html),然后使用Mac OS Finder将生成的文件系统文件夹复制粘贴到您的Gluon Mobile项目中。
提示:请注意不要混淆位于其中的资产目录文件夹和资产文件夹。
我的Intellij项目的屏幕截图,其中包含两个资产文件夹AppIcon.appiconset
和LaunchImage.launchimage
:
请注意每个资产文件夹中的Contents.json
个文件。一旦由XCode创建,我不建议您手动更改任何内容,除非您确切知道自己在做什么。
然后使用Info.plist中的条目引用资源文件夹,如下所示:
<?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>
请注意,有不同类型的资产文件夹。除了'... appiconset'资产文件夹之外,您还需要一个...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