当前位置:   article > 正文

Error: Google Play requires that apps target API level 26 or higher. 两种解决办法_google play requires that apps target api level 31

google play requires that apps target api level 31 or higher.
这个问题是Android Studio和SDK升级后出现的,在编译Release版本的时候报错。


两种解决办法:


1)在targetSdkVersion 上面一行加注释:

//noinspection ExpiredTargetSdkVersion

2) 在android {} 块中加入,具体位置 app/build.gradle -> android -> defaultConfig

lintOptions {
    abortOnError false
}

出错信息如下:

Task :app:lintVitalRelease
E:\work\projects\BluetoothControl\app\build.gradle:23: Error: Google Play requires that apps target API level 26 or higher.
 [ExpiredTargetSdkVersion]
        targetSdkVersion 24
        ~~~~~~~~~~~~~~~~~~~

   Explanation for issues of type "ExpiredTargetSdkVersion":
   As of the second half of 2018, Google Play requires that new apps and app
   updates target API level 26 or higher.

   Configuring your app to target a recent API level ensures that users
   benefit from significant security and performance improvements, while still
   allowing your app to run on older Android versions (down to the
   minSdkVersion).

   To update your targetSdkVersion, follow the steps from "Meeting Google Play
   requirements for target API level",
   https://developer.android.com/distribute/best-practices/develop/target-sdk.
   html

   https://support.google.com/googleplay/android-developer/answer/113469#targetsdk
   https://support.google.com/googleplay/android-developer/answer/113469#targetsdk
   https://developer.android.com/distribute/best-practices/develop/target-sdk.html

1 errors, 0 warnings

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/763618
推荐阅读
相关标签
  

闽ICP备14008679号