I had been trying to get cpp-tests to build on my machine (split abi) with various guides on this forum:
- https://github.com/Senspark/cocos2d-x-3.15
- Cocos2d-x Android Studio NDK build C++ DEBUG - WORKS!
- How to link prebuilt Cocos2D X C++ library to Android Studio project?
But it didn’t work for me. Spilling error messages here and there.
So obviously the configuration on my machine and others are so different that it didn’t work.
To minimize that, I downloaded a virtualbox images from osboxes.org Ubuntu_17.10_10th-August-VB-64bit.7z and setting up the environment from a clean slate:
- android-studio-ide-162.4069837-linux.zip extracted to
/home/osboxes/android-studio
-
cocos2d-x-3.14.1.zip (because 3.15.1 doesn’t allow prebuilt with gen-libs anymore) extracted toshould still use cocos2d-x-3.15.1/home/osboxes/cocos2d-x-3.14.1
-
android sdk tools 26.1.1use android sdk tools 25.2.3 instead, platform-tools 26.0.0 (downloaded automatically by Android studio) at/home/osboxes/Android/Sdk
- android ndk 15.2.4203891 (downloaded automatically by Android studio) at
/home/osboxes/Android/Sdk/ndk-bundle
- apache ant 1.9.9 installed via
sudo apt-get install ant
- python 2.7.14 installed via
sudo apt-get install python
Here’s the result of cocos2d setup.py
Setting up cocos2d-x...
->Check environment variable COCOS_CONSOLE_ROOT
->Search for environment variable COCOS_CONSOLE_ROOT...
->COCOS_CONSOLE_ROOT is found : /home/osboxes/cocos2d-x-3.14.1/tools/cocos2d-console/bin
->Check environment variable COCOS_X_ROOT
->Search for environment variable COCOS_X_ROOT...
->COCOS_X_ROOT is found : /home/osboxes
->Check environment variable COCOS_TEMPLATES_ROOT
->Search for environment variable COCOS_TEMPLATES_ROOT...
->COCOS_TEMPLATES_ROOT is found : /home/osboxes/cocos2d-x-3.14.1/templates
->Configuration for Android platform only, you can also skip and manually edit "/home/osboxes/.bashrc"
->Check environment variable NDK_ROOT
->Search for environment variable NDK_ROOT...
->NDK_ROOT is found : /home/osboxes/Android/Sdk/ndk-bundle
->Check environment variable ANDROID_SDK_ROOT
->Search for environment variable ANDROID_SDK_ROOT...
->ANDROID_SDK_ROOT is found : /home/osboxes/Android/Sdk
->Check environment variable ANT_ROOT
->Search for environment variable ANT_ROOT...
->ANT_ROOT is found : /usr/share/ant/bin
Please execute command: "source /home/osboxes/.bashrc" to make added system variables take effect
But still could not execute gen-libs properly cocos gen-libs -p android --ap android-22 --android-studio --app-abi x86 armeabi armeabi-v7a
Invalid or unsupported command "update project -t android-22 -p /home/osboxes/cocos2d-x-3.14.1/tools/simulator/frameworks/runtime-src/proj.android"
Supported commands are:
android list target
android list avd
android list device
android create avd
android move avd
android delete avd
android list sdk
android update sdk
Error running command, return code: 2.
Error running command, return code: 14.
I guess some of my setup have wrong version or something.
Please help me correct the configuration to spare me/and other newbies the compile fatigue.
Thanks.