APK errors

Play: targetSdk level too low

Error text

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.

Cause

Google Play requires a minimum targetSdk for new and updated apps. Below it, the upload is rejected.

Step-by-step fix

  1. Read the required API number in the Play Console warning.
  2. Raise compileSdk and targetSdk to that number.
  3. Read the Android behavior changes: notifications, foreground services, file permissions.
  4. Test every screen on a new Android emulator.
  5. Build a new AAB, raise versionCode and upload.

Example commands

android { defaultConfig { targetSdk = 34 } compileSdk = 34 }
./gradlew bundleRelease
adb shell am compat list    # davranış dəyişikliklərini sına

How to prevent it

Raise targetSdk yourself each summer, before the new requirement hits.

Author and license: Nibras Code