Last updated: August 14, 2019
-
Install the latest version of Android Studio.
-
Install and set up Java using Java Development Kit.
-
Install Python 2. Do not install Python 3.
-
Download Ant 1.9.14 and unzip it to C:\ant.
-
Download NDK R12b and unzip it to C:\ndk.
-
Download Cocos2d-x 3.14.1 and unzip it to C:\cocos.
-
Download Android SDK tools 25.2.5 and unzip it to C:\tools.
-
Install cocos command line tool.
cd C:\cocos
setup.py
It will prompt the following variables:
- ANDROID_SDK_ROOT: Enter the directory from Step 1.4 above
- NDK_ROOT: C:\ndk\android-ndk-r12b
- ANT_ROOT: C:\ant\apache-ant-x.xx.x\bin
-
Download Firebase CPP SDK and unzip in goa folder. Copy and past firebase folder from firebase_cpp_sdk\include to cocos2d\cocos folder.
- Make sure an Android device is connected with USB debug permissions set.
- Overwrite the directory tools in ANDROID_SDK_ROOT with C:\tools
cd goa
cocos compile -p android
- Copy the content of proj.android\libs folder into proj.android-studio\goa\src\locale\jniLibs folder. For example for English build copy to proj.android-studio\goa\src\english\jniLibs Note: Copy only .so files.
- Start Android Studio and import proj.android-studio folder into it.
- Download the OBB file from the latest GitHub release and follow the instructions provided there.
- To change the app locale, just select the desired language from the build variant.
- Set the
localeCode
in LevelHelpScene.h file as per the build variant. - Build the project.
By default, the Kiosk mode is enabled. So all the games are open. To disable Kiosk mode, set the KIOSK variable in
goa/Classes/menu/ScrollableGameMapScene.cpp
to false
static const bool KIOSK = false;
-
How can I resolve an error encountered after running the "setup.py" script while installing cocos?
To resolve an error encountered after running the “setup.py” script while installing cocos, check whether you have Python 3 installed. If you do have Python 3 installed, uninstall it and try running setup.py again.
-
The application throws keystore file not found error. How do I fix this?
keystore file is used to digitally sign an Android application and hence, it is not provided with the project. One must create their own keystore file using the Android KeyTool which comes with the Android Studio in order to sign the APK.
-
How to fix missing google-services.json file error?
Put google-services.json file in app folder. It is there in Firebase console after the app project has been created.
-
How to enable the Build variant option in the Build menu?
The Build variant option is enabled only when the module's gradle file is opened.