首页 > 解决方案 > 如何从 config.xml 为 phonegap 定位 android 的 API 级别?

问题描述

我曾经使用基本的 config.xml 文件为 play store 的 phonegap 构建应用程序,直到最近我的应用程序被拒绝,因为它们没有针对 API 级别 26。我做了一些研究并尝试了一些解决方案并做到了这一点:

<platform name="android">
    <allow-intent href="market:*" />
    <preference name="android-minSdkVersion" value="26" />
    <preference name="android-targetSdkVersion" value="26" />
</platform>

情况变得越来越糟,我在调试模式下的应用程序(在 phonegap 构建上进行了 xompilation 之后)甚至不会在 android 上被解析。

我同样阅读了几个解决方案,但似乎没有一个能走。我真的只是想知道我应该在 config.xml 文件中包含什么,以便我可以重新开始。

标签: androidphonegap-buildgoogle-developers-console

解决方案


我的 config.xml 文件有这两行,但它们放在外面

<platform name="android"></platform>

以下是我使用的值,并且我的应用程序在 Apple 和 Google 应用程序商店中都存在:

<preference name="android-targetSdkVersion" value="26" />
<preference name="android-minSdkVersion" value="14" />

如果您想要我的完整 config.xml 文件的示例,请告诉我!:)


推荐阅读