android开发打包配置targetSdk小于33的时候报错出现ExpiredTargetSdkVersion问题解决方法
1.问题现象
Error: Google Play requires that apps target API level 33 or higher. [ExpiredTargetSdkVersion]
targetSdk 29
~~~~~~~~~~~~
Explanation for issues of type "ExpiredTargetSdkVersion":
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://developer.android.com/distribute/best-practices/develop/target-sdk.html
1 errors, 0 warnings
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:lintVitalRelease'.
Lint found fatal errors while assembling a release target.
Fix the issues identified by lint, or create a baseline to see only new errors.
To create a baseline, run `gradlew updateLintBaseline` after adding the following to the module's build.gradle file:
android {
lint {
baseline = file("lint-baseline.xml")
}
}
For more details, see https://developer.android.com/studio/write/lint#snapshot
Error: Google Play requires that apps target API level 33 or higher. [ExpiredTargetSdkVersion]
targetSdk 29
~~~~~~~~~~~~
Explanation for issues of type "ExpiredTargetSdkVersion":
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://developer.android.com/distribute/best-practices/develop/target-sdk.html
1 errors, 0 warnings
2. 解决方法
在targetSdk上面添加注解://noinspection ExpiredTargetSdkVersion
,这样就能解决打包问题,不过打出来的包上架不了GooglePlay哦,因为此时的GooglePlay要求targetSdk必要33以上了