Google Play AAB rejected for low targetSdkVersion in CI
Google Play rejected the AAB because its targetSdkVersion is below the minimum API level Play enforces for new app uploads. The bundle is valid and signed, but Play blocks the upload until the target API level is raised.
What this error means
supply fails with "Google Api Error: Your app must target API level N or higher" or "targetSdkVersion ... is no longer accepted". The build and signing succeeded; the target API level is the blocker.
[!] Google Api Error: Invalid request - Your app currently targets API level 33 and must
target at least API level 34 to ensure it is built on the latest APIs optimized for
security and performance.Common causes
targetSdkVersion is below the Play minimum
Google Play raises the required target API level for new uploads each year; an app below the current floor is rejected.
compileSdk lags so the target cannot be raised
Raising targetSdkVersion needs a matching compileSdkVersion and updated build tooling, which were not bumped.
How to fix it
Raise compileSdk and targetSdk
- Update compileSdkVersion and targetSdkVersion to the required level.
- Resolve any new behavior changes the higher target introduces.
- Rebuild the AAB and re-upload.
android {
compileSdkVersion 34
defaultConfig { targetSdkVersion 34 }
}Use a deadline-aware track if eligible
Some accounts get an extension window. Check the Play Console for the exact required level and deadline, then plan the bump before it lapses.
How to prevent it
- Track Google Play target API level requirements each year.
- Bump compileSdk and targetSdk together with build tooling.
- Test behavior changes from the higher target before release.