Search code examples
androidandroid-studioandroid-buildandroid-buildconfig

Can't set targetSdkVersion = 29


I am developing an Android application which use a native library and native library supports targetSDKVersion = 29 only. I created a new Android project has default targetSDKVersion =31, I tried to set targetSDKVersion as 29, but I got the error messsage as below image:

enter image description here

I have another Android project it has targetSDKVersion = 29 without error message, I don't know why I can't set targetSDKVersion = 29 for the first project.

enter image description here

How can I set targetSDKVersion as 29?


Solution

  • You can suppressing the error by adding the following before targetSdkVersion declaration :

    noinspection ExpiredTargetSdkVersion
    

    See Target API level requirements for Google Play apps:

    To help ease the transition, we are delaying the enforcement deadline for app discoverability from November 1, 2022 to January 31, 2023. You can continue to request an extension if you need more time to update your app to target API level 31 or above by submitting an extension request for your app to continue being discoverable to all Google Play users until May 1, 2023. Check your Play Console Inbox Messages for links to each of your app’s extension forms.