关于Google Play API最低级别要求

时间:2018-09-10 21:23:56

标签: android phonegap

我刚刚使用Phonegap发布了一个新应用。当我上传到Play商店时。我收到了此警告信息

  

Google Play将要求新应用至少针对Android 8.0   (API级别26)从2018年8月1日开始,并且该应用更新目标   从2018年11月1日开始使用Android 8.0。

     

每个新的Android版本都引入了带来重大变化的更改   安全性和性能改进–增强用户   整体Android经验。其中一些更改仅适用于   通过targetSdkVersion明确声明支持的应用程序   清单属性(也称为目标API级别)。

好吧,我将API级别提高到26,并且在尝试安装时显示“设备不兼容”。我检查了手机的Android版本,即6.0版本。我能够理解API级别26是版本8。

问题是-我该怎么办?如何为其他版本的用户安装我的应用?

谢谢。

1 个答案:

答案 0 :(得分:0)

There are two relevant settings here. Target SDK version is what Google is looking for. That's the SDK that your app is optimized for. Min SDK version is the lowest version your app will run on (there is also a max SDK version, but I have never had a use for it). You'll need to update your Config.xml file with the min sdk version tag. You'll have something like this:

<?xml version="1.0" encoding="UTF-8" ?>
<widget xmlns   = "http://www.w3.org/ns/widgets"
    xmlns:gap   = "http://phonegap.com/ns/1.0"
    id          = "com.phonegap.example"
    versionCode = "10"
    version     = "1.0.0" >

  <name>PhoneGap Example</name>
  <description>
      An example for phonegap build docs.
  </description>
  <author href="https://build.phonegap.com" email="support@phonegap.com">
      wildabeast
  </author>

  <!-- all platforms -->
  <preference name="phonegap-version" value="cli-6.0.0" />
  <preference name="orientation" value="landscape" />
  <preference name="fullscreen" value="true" />

  <!-- Android only -->
  <preference name="android-build-tool" value="ant|gradle" />
  <preference name="android-minSdkVersion" value="23" />
  <preference name="android-targetSdkVersion" value="26" />
  <preference name="android-installLocation" value="auto" />
</widget>

The key line is near the bottom:

<preference name="android-minSdkVersion" value="23" />

You can read more here: http://docs.phonegap.com/phonegap-build/configuring/preferences/#android-minSdkVersion