[英]Android PlayStore warning your app currently targets API level 25
Warnings Your app currently targets API level 25 and must target at least API level 26 to ensure it is built on the latest APIs optimized for security and performance.
警告 您的应用目前以 API 25 级为目标,并且必须至少以 API 26 级为目标,以确保它建立在针对安全性和性能优化的最新 API 之上。
From August 2018, new apps must target at least Android 8.0 (API level 26).
从 2018 年 8 月开始,新应用程序必须至少以 Android 8.0(API 级别 26)为目标。 From November 2018, app updates must target Android 8.0 (API level 26).
从 2018 年 11 月开始,应用更新必须以 Android 8.0(API 级别 26)为目标。
Tip: Change your app's target API level.
提示:更改应用的目标 API 级别。 Learn how.
学习如何。
I am using Cordova and Ionic 3. Just built the app using: ionic cordova build android --release-prod
我正在使用 Cordova 和 Ionic 3。刚刚构建的应用程序使用:
ionic cordova build android --release-prod
What should I do, ignore this or fix and how?我该怎么办,忽略这个或修复以及如何修复?
Thanks.谢谢。
You can update your cordova-android to 7.0.0 as that's the version that uses SDK 26 as target, or you can update to cordova-android 7.1.4, as it targets SDK 27.您可以将您的 cordova-android 更新到 7.0.0,因为这是使用 SDK 26 作为目标的版本,或者您可以更新到 cordova-android 7.1.4,因为它以 SDK 27 为目标。
You can do it by removing the platform and adding it again specifying the version to use like this: (if not using ionic, remove the ionic word from both commands)您可以通过删除平台并再次添加它来指定要使用的版本,如下所示:(如果不使用 ionic,请从两个命令中删除 ionic 词)
ionic cordova platform rm android
ionic cordova platform add android@7.1.4
If you don't want or can't update, you can try to set the target SDK with this preference in the config.xml如果您不想或无法更新,您可以尝试在 config.xml 中使用此首选项设置目标 SDK
<preference name="android-targetSdkVersion" value="26"/>
And then run ionic cordova prepare
然后运行
ionic cordova prepare
In Flutter : I have also get a similar error in Flutter project
* 'Your app currently targets API level 28 and must target at least API level 29 to ensure that it is built on the latest APIs optimised for security and performance.在 Flutter 中:我在
Flutter project
也遇到了类似的错误 *“您的应用程序当前面向 API 级别 28,并且必须至少面向 API 级别 29,以确保它构建在针对安全性和性能进行了优化的最新 API 上。 Change your app's target API level to at least 29 flutter'*将您应用的目标 API 级别更改为至少 29 flutter'*
So I tried to know what and why this error is occur for, So i got this solution所以我试图知道发生这个错误的原因和原因,所以我得到了这个解决方案
Is it need to change both compileSdkVersion
and targetSdkVersion
to 29 , Follow the below step to change是否需要将
compileSdkVersion
和targetSdkVersion
都compileSdkVersion
29 ,按照下面的步骤改
Go to Your_Project_Directory/android/app/build.gradle
and change your target into:转到
Your_Project_Directory/android/app/build.gradle
并将您的目标更改为:
compileSdkVersion 29 targetSdkVersion 29
This is because Google has made it compulsory for apps to target at least 26 API level by August 2018 for new apps and November 2018 for updating apps.这是因为谷歌强制要求应用程序在 2018 年 8 月之前针对新应用程序和 2018 年 11 月针对更新应用程序至少针对 26 个 API 级别。
You can do it by removing the platform and adding it again specifying the version to use like this: (if not using ionic, remove the ionic word from both commands)您可以通过删除平台并再次添加它来指定要使用的版本,如下所示:(如果不使用 ionic,请从两个命令中删除 ionic 词)
ionic cordova platform rm android ionic cordova platform add android@7.1.4 If you don't want or can't update, you can try to set the target SDK with this preference in the config.xml ionic cordova platform rm android ionic cordova platform add android@7.1.4 如果你不想或者不能更新,可以尝试在config.xml中用这个preference设置target SDK
This worked for me!这对我有用!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.