简体   繁体   中英

About Google's Play API minimum level requirement

I just released a new app using Phonegap. As I uploaded on Play store. I got this warning info

Google Play will require that new apps target at least Android 8.0 (API level 26) from August 1, 2018, and that app updates target Android 8.0 from November 1, 2018.

Every new Android version introduces changes that bring significant security and performance improvements – and enhance the user experience of Android overall. Some of these changes only apply to apps that explicitly declare support through their targetSdkVersion manifest attribute (also known as the target API level).

Well, I increased the API level to 26, and when I tried to install, it says "device not compatible". I checked my phones Android version, it was version 6.0. I was able to understand that API level 26 is version 8.

Question is - what do I do about this? How can I have my app for other version users?

Thank you.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM