Android Studio Setup - Cocos2d-x

Having trouble with initial setup build for android. Using windows 10. I am attempting to run the cpp-tests like in the programmer documentation. I have gotten those tests to work in visual studio, but I would like to build to android, so I am trying to get those tests to work on android studio. I definitely downloaded the NDK from the SKD tools area, but it does not show in the project config, and I cannot select it(greyed out). It does show outside of project though in the default settings. Gradle plugin 3.1.0, Gradle version 4.8.1. I played around with version numbers for NDK and Gradle, not sure how to fix, thanks.

Which version of Cocos2d-x?

Cocos2d-x 4.0

I was able to get past this error with the info from a YT video, mainly the Gradle versions (4.1 plugin and 6.5 for version). Then putting ndk.dir=PATH in the file. Though there are still some warnings if anyone knows the best versions of the individual components feel free to let me know.

It should work, but if you run into trouble, you can always try the fork of Cocos2d-x v4 that is more up-to-date and definitely does not have these issues.

Hi @Sterfry did you solve your issues? I managed to get past that, but unfortunately didn’t get much further… Right now my Windows completely freezes when trying to compile cocos. At first I wondered that maybe this is Android Studio’s fault since it is not super reliable, but when I manually run gradle task externalNativeBuildDebug from command line, I get exactly same results. Just freezes in the middle of the compilation, no error, nothing…

Gamestudio two made a nice video

Thanks for quick reply! Unfortunately I got the same results like with my config. There is soemthing wrong with my environment, hard to tell what. Anyway, I managed to successfully build it on a different machine running macOS.