Gradle Sync Failed(What version of Gradle and Android Gradle plugin to use with Cocos2d-x 3.17)

Hello, I am using Android Studio 3.1.2 and Cocos2d-x V 3.17, I imported the cpp-tests project and everything worked fine. But then I created a new cocos2dx project called “MyGame” and imported and tried to run and I get the following error, I looked at this post https://discuss.cocos2d-x.org/t/solved-gradle-sync-error/42684 and tried his solution but nothing showed up on my android studio terminal, please can anyone with gradle experience help me with this error so I could continue building my project I am not that familiar with gradle, thanks everybody!

for me it looks like u upgraded gradle version thru android-studio when launched project, isnt?

I think I may have updated a few weeks ago, is there a way to check what version of Gradle I am using ? and if its incompatible to revert ? I think there is 2 gradle and gradle plugin because android studio asks me to update both of them.

It is inside android-studio/ build.gradle file there is listed gradle version. Im not sure which gradel version is in use for cocos2d-x 3.17 but before with 3.16 android studio asked on procjet launch if I want to update it and then there was a lot of issue due it, so better to skip that update propoused by ~Android studio

Both of my the projects have the same gradle version in build.gradle(proj.androidstudio) it says ‘com.android.tools.build:gradle:3.0.0’

and in gradle-wrapper.properties(Gradle Version) it says distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip

for both of my projects have the same thing so I wonder why the cpp-tests project is building but not the new project I created

16%20PM

What about java version? Which one u installed - there was some issue with 1.9

I hava Java 1.8 installed on my system, but wouldn’t this cause both cpp-tests and MyGame to not run ? cpp-tests run perfectly so I don’t get why a newly created project also doesn’t run perfectly

Ok, last hope :slight_smile: what if ndk path not provided properly or wrong ndk used:)

1 Like

that was the problem filled it in with my ndk path and everything worked fine, thanks for you help I really do appreciate it!
08%20PM