My android app receieved an email from Google:
" Starting August 31, 2024 , new apps and app update submissions must target Android 14 (API level 34), except for Wear and TV OS apps, which must target Android 13 (API level 33) or higher. Existing apps must target Android 13 (API level 33) or higher to remain available to new users on devices running Android OS higher than your app’s target API level. To save time and effort, you can use the new SDK Upgrade Assistant in Android Studio. You will also be able to request an extension until November 1, 2024 if you need more time to update your app."
What do I do to fix this error and upload my app back to the play store?
You need to update to Capacitor 6 which uses API level 34.
3 Likes
Update your app to target Android 14 (API level 34). Use Android Studio’s SDK Upgrade Assistant, test your app, and re-upload it. Request an extension until November 1, 2024, if needed.
Cordova i am not able to update to sdk 34 i got error
I am trying to update target sdk version from 33 to 34.I Executed the command ionic cordova build android
My Environment:
ionic -v - 7.0.2
cordova- v - 12.0.0
node -v - v20.11.1
npm -v -10.8.1
gradle -v -Gradle 8.6
ng --version ’ or ’ ng version ’ or ’ ng v ’ -18.0.6
i got error like A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
AAPT2 aapt2-4.2.2-7147631-windows Daemon #0: Unexpected error during link, attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.
while build app with target sdk 34
I am updated to Ionic v8 and capacitor 6 using the migration guide. The targetSdkVersion is still 33 and causing an error when I upload a new release to the play store. Any guidance?
Can I manually bump the targetSdkVersion to 34 then run ionic cap sync android, and resubmit if I have followed all the steps in the migration guide you provided?
how did you update? manually or using npx cap migrate
command?
If you used npx cap migrate
, did you update @capacitor/cli
to latest first?
I believe I did it manually several months ago following the guide.
Ok so I updated @capacitor/cli and ran npx cap migrate. It succeeded but the targetSdkVersion is still 33.
Are you sure you installed @capacitor/cli
version 6?
can you share the log messages migrate command shows?
Hey Julio, were you able to review my console print off?
There are only one warning that can happen when some plugin is not updated for Capacitor 6, but it says it updated the variables.gradle
successfully, so it should have updated the targetSdkVersion
to 34, but you say it didn’t, so I don’t know what could have happened.
Does the targetSdkVersion
declaration in the app’s build.gradle
looks like this targetSdkVersion rootProject.ext.targetSdkVersion
?
or in which files you see that targetSdkVersion
was not updated?
This is my variables.gradle
ext {
minSdkVersion = 22
compileSdkVersion = 34
targetSdkVersion = 34
androidxActivityVersion = '1.8.0'
androidxAppCompatVersion = '1.6.1'
androidxCoordinatorLayoutVersion = '1.2.0'
androidxCoreVersion = '1.12.0'
androidxFragmentVersion = '1.6.2'
junitVersion = '4.13.2'
androidxJunitVersion = '1.1.5'
androidxEspressoCoreVersion = '3.5.1'
cordovaAndroidVersion = '10.1.1'
coreSplashScreenVersion = '1.0.1'
androidxWebkitVersion = '1.9.0'
}
But then the build.gradle targetSdkVersion never upgraded to 34. This is what it looks like:
android {
namespace "com.encoded.example"
compileSdkVersion 34
defaultConfig {
applicationId "com.encoded.mogastaxback"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion 33
versionCode 62
versionName '13.4.1'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
Yeah, the migration script only updates variables.gradle
file.
In the apps build.gradle
it should appear like this targetSdkVersion rootProject.ext.targetSdkVersion
, so it picks the value from variables.gradle
, but looks like you changed it to be 33, so you have to update it to 34 now, or back to targetSdkVersion rootProject.ext.targetSdkVersion
so it gets the value from variables.gradle
and gets automatically updated by npx cap migrate
next time.
And you should also update the compileSdkVersion 34
to compileSdk rootProject.ext.compileSdkVersion
1 Like