我已按照本教程https://iphonedevlog.wordpress.com/2014/12/12/adding-an-android-apk-expansion-file-to-a-cordova-project实施了扩展文件。我使用了扩展文件cordova插件https://github.com/agamemnus/cordova-plugin-xapkreader/tree/cordova-6.5.0。
我将该应用程序发布为alpha来玩商店进行测试。应用程序在启动时崩溃,并提供下载通知,如下图所示。
答案 0 :(得分:0)
我们需要修改一些配置如下:
<variable name="XAPK_EXPANSION_AUTHORITY" value="PACKAGE_NAME" />
<variable name="XAPK_PUBLIC_KEY" value="PUBLIC_API_KEY" />
<variable name="XAPK_PATCH_VERSION" value="-1" />
在./plugins/android.json
中"com.flyingsoftgames.xapkreader": {
"XAPK_EXPANSION_AUTHORITY": "PACKAGE_NAME",
"XAPK_PUBLIC_KEY": "PUBLIC_API_KEY",
"XAPK_PATCH_VERSION": "-1"
}
在./platforms/android.json
中"res/values/xapkreader.xml": {
"parents": {
"/*": [
{
"xml": "<string name=\"xapk_expansion_authority\">PACKAGE_NAME</string>",
"count": 1
},
{
"xml": "<string name=\"xapk_google_play_public_key\">PUBLIC_API_KEY</string>",
"count": 1
},
{
"xml": "<integer name=\"xapk_patch_version\">-1</integer>",
"count": 1
}
]
}
}
位于./platforms/res/values/xapkreader.xml
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<string name="xapk_expansion_authority">PACKAGE_NAME </string>
<string name="xapk_google_play_public_key">PUBLIC_API_KEY </string>
<integer name="xapk_patch_version">-1</integer>
</resources>
注意:不要忘记将PACKAGE_NAME和PUBLIC_API_KEY替换为您的应用程序配置。