Gradle error while trying to build for targetSdkVersion 32

I have an old project in cocos2dx 3.16.1 cpp, I was trying build for targetSdkVersion 32 but got gradle sync errors.
I’m using following versions of tools:
Android Studio 2020.3.1
Gradle Plugin 7.2.0
Gradle 7.4.2
ndkVersion “25.0.8775105”

I have these plugins in app level build.gradle

plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
    id 'com.google.firebase.crashlytics'
    id 'com.google.firebase.firebase-perf'
}

I’m getting this error:
> java.util.NoSuchElementException: Key GNUSTL_STATIC is missing in the map.

Can anyone help me with it?

Use following thigs.

1)classpath ‘com.android.tools.build:gradle:4.1.3’
classpath ‘com.google.gms:google-services:4.3.14’
classpath ‘com.google.firebase:firebase-crashlytics-gradle:2.9.2’
classpath ‘com.google.firebase:perf-plugin:1.4.2’
2)
gradle-6.5-bin.zip

cmake_minimum_required(VERSION 3.10)

SourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8

multiDexEnabled true

Still not working, now I got this:
Build-tool 32.0.0 is missing DX
Android NDK: APP_STL gnustl_static is no longer supported.

I tried with renaming D8 to DX but still it didn’t work.
It says:
An API level of 32 is not supported by this compiler

Hello sir plz can u help? Were you really able to target for android 12? It’s not working for me. :frowning:
Getting different error while switching to different gradle version:
Now I’m getting this error with gradle plugin 7.2.0
make: *** No rule to make target 'MyGame'. Stop.

Hi m8 ok only suggest is to upgrade to 3.17.2 and let cocos create new compiler settings
I have created a video of your problems. 2022 12 20 08 49 30 - YouTube

1 Like

Thanks for your time and effort you have made sir :slight_smile:
Upgrading to 3.17.2 is the only option left.

1 Like

Thank you.! you are the saviour of cocos2dx.

Your welcome always happy to help out. it’s begging to get close to for me to do a series of tutorial’s in programming for cocosa2dx. I did say I would if enough people asked in a different thread.

1 Like

Hello Sir,
I gotta ask you again one more thing… Do you work with javascript version too? With v3.17.2 the js version is not working on Android it’s showing blank black screen only but it works on iOS.

No i’m using c++ sorry about that

1 Like