我刚刚发布了一款使用 Phonegap 的新应用。正如我在 Play 商店上传的那样。我得到了这个警告信息
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).
好吧,我将 API 级别提高到 26,当我尝试安装时,它显示“设备不兼容”。我检查了我的手机Android版本,它是6.0版。我能够理解 API 级别 26 是版本 8。
问题是 - 我该怎么办?如何让其他版本的用户使用我的应用程序?
谢谢。
最佳答案
这里有两个相关的设置。目标 SDK 版本是 Google 正在寻找的。这是您的应用程序针对的 SDK。最低 SDK 版本是您的应用程序将运行的最低版本(还有最高 SDK 版本,但我从未使用过它)。您需要使用最小 sdk 版本标记更新您的 Config.xml 文件。你会有这样的东西:
<?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>
关键线在底部附近:
<preference name="android-minSdkVersion" value="23" />
您可以在此处阅读更多信息:http://docs.phonegap.com/phonegap-build/configuring/preferences/#android-minSdkVersion
关于android - 关于 Google 的 Play API 最低级别要求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52265669/