Cmake Error on Android

Cmake Error on Android
0

Hi, I’ve been working solo on a Cocos2D-JS game, and after making the game for web, I’m now having trouble getting an Android or iOS version working. For some reason I thought the process would be mostly automatic, and there don’t seem to be any simple instructions for noobs like me, so I’m pretty concerned whether or not I’ll be able to get my game working natively on phones. I would realllly appreciate your help!

Here’s a demo version of the game on web if you want to try it! (Open it with a mobile browser, or put your browser in mobile mode beforehand). Emoji Pop Demo

For now I’m working on Android. I’m using Cocos2d-x-JS version 3.17.1. Android Studio 3.5.2. NDK: android-ndk-r20b.

After working out a few minor kinks, I get this error after running the game from within Android Studio: ERROR: Cause: executing external native build for cmake

Which I believe refers to this code in the app’s build.gradle file:
externalNativeBuild {
if (PROP_BUILD_TYPE == ‘ndk-build’) {
ndkBuild {
path “jni/Android.mk”
}
}
else if (PROP_BUILD_TYPE == ‘cmake’) {
cmake {
path “…/…/…/…/CMakeLists.txt”
}
}
}

I followed this 2014 cocos-js android tutorial, but it seems out of date. I tried opening the android.proj folder as suggested in this more recent cocos2d-x 3.17.1 tutorial, but am left with the above error when I try to Sync Project with Gradle FIles.

I noticed no Modules listed in Project Structure, and was wondering if I have to manually add a Module to connect with my cocos game? In the Log File, one warning repeats a lot “WARN - un.AndroidRunConfigurationBase - Can’t get application ID: Android module missing”. Or maybe I have to try using CocosJS 3.17 which doesn’t use cmake?

I’m sure I’m missing some obvious things, but have very little software dev experience, I’m a game designer who chose CocosJS for its ease (also not a fan of Unity/Cocos Creator tools) and multi-platform functionality. In addition to specific help on this problem, I’d love to find some specific educational resources for exporting Cocos-JS projects!

I’ll follow up as quickly as I can with other information that is needed! Thank you so much in advance!

Here’s the full Log file I posted on Google Docs: https://docs.google.com/document/d/13BgjdiKnnokXbmuR3IGhrjd8oYJgMBw4qGhCBsuUOtQ/edit?usp=sharing

Here’s the CMakeLists.txt file: https://docs.google.com/document/d/1QWslKQ6uljEHTyLjFQN4xJjBq_3g_kPQ2uEo4WTo_DE/edit?usp=sharing