Android build fails when targeting API level 35 (Android 15)

Hi, Google recently warned developers to update their apps/games to target SDK 35 (Android 15), or else their apps may be removed from the Google Play Store.

When I tried building my game using Cocos Creator 3.7.4 with the Target API Level set to "android-35", the build process failed (in the make stage).

I also tried creating a new empty project with Cocos Creator 3.8.6, but it resulted in the same error. Here are the error logs:

2: Task failed with an exception.

-----------

* What went wrong:

Execution failed for task ':TestProject:bundleReleaseResources'.

> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2ProcessResourcesRunnable

   > Android resource linking failed
     aapt2.exe E 07-06 04:38:24 16452  4856 LoadedArsc.cpp:94] RES_TABLE_TYPE_TYPE entry offsets overlap actual entry data.
     aapt2.exe E 07-06 04:38:24 16452  4856 ApkAssets.cpp:152] Failed to load resources table in APK 'C:\Users\Morteza\AppData\Local\Android\Sdk\platforms\android-35\android.jar'.
     error: failed to load include path C:\Users\Morteza\AppData\Local\Android\Sdk\platforms\android-35\android.jar.

I’m using JDK 17.0.15+6 and NDK version 23.2.8568313.

I also tried using a newer version of Gradle (at least 8.6.0, as required for SDK 35), but the build still fails with the same error. Here’s my build.gradle file:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        mavenCentral()
        // jcenter() // keeped as anchor, will be removed soon
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.11.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
        // jcenter() // keeped as anchor, will be removed soon
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Question:
How can I build a game that targets Android API level 35? Is it not supported yet?

Does this issue need to be resolved so I can target Android 15?

this because of Android studio, Update android studio resolve the problem. You can try the latest stable version

I’m already using the latest version of Android Studio so this can’t be the issue.
Were you able to build for Android successfully while targeting SDK 35? Which version of Cocos Creator and NDK are you using? Also, did you change any other config like the gradle plugin version?

Thanks.

Sorry, i am busy these day, so i just check the forums now.
i using cocos 2.x, but i think the problem may be the same.
i use gradle plugin 8.4.1 and gradle version 8.6.
and android studio 2025.1.1
You can tried with that configs, or share the your android project, i will try with you to find the solution.
i am feel bad when ecounter this problems before, the forums seem to slient.

1 Like

Thank you for your response. I was able to resolve this issue by properly updating the Gradle version. The problem was that I thought if I changed the Gradle plugin version inside the file at native/engine/google-play/build.gradle, it would update the Gradle plugin version of the actual build projects. Apparently, it does not. So, I changed them manually, and the build process completed successfully.

I am glad that you find the solution