However, I got error when run python android-build.py -p 22 cpp-tests:
I got this log from cmd :
Building native...
NDK build mode: debug
running: '"C:\Users\ToanTM\AppData\Local\Android\sdk\ndk-bundle\ndk-build" -C D:
\cocos2d-x-3.14.1\tests\cpp-tests\proj.android -j4 APP_ABI="armeabi-v7a" NDK_MOD
ULE_PATH=D:\cocos2d-x-3.14.1;D:\cocos2d-x-3.14.1\cocos;D:\cocos2d-x-3.14.1\exter
nal NDK_TOOLCHAIN_VERSION=4.9 NDK_DEBUG=1'
Android NDK: WARNING: APP_PLATFORM android-22 is larger than android:minSdkVersi
on 9 in ./AndroidManifest.xml
Android NDK: WARNING: Ignoring unknown import directory: D:\cocos2d-x-3.14.1
Android NDK: jni/Android.mk: Cannot find module with tag 'cocos' in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:
make: Entering directory `D:/cocos2d-x-3.14.1/tests/cpp-tests/proj.android'
jni/Android.mk:170: *** Android NDK: Aborting. . Stop.
make: Leaving directory `D:/cocos2d-x-3.14.1/tests/cpp-tests/proj.android'
Error running command, return code: 2.
Build dynamic library for project [ D:\cocos2d-x-3.14.1\build\..\tests\cpp-tests
] failed!
I tried another way to compile the project for Android Studio following Sonar Systems’s tutorial here: https://www.youtube.com/watch?v=gdOkbXYsf04 with this command cocos compile -p android --android-studio -- ap android-19. But still the same error:
Building native...
NDK build mode: debug
running: '"C:\Users\ToanTM\AppData\Local\Android\sdk\ndk-bundle\ndk-build" -C D:
\cocos2d-x-3.14.1\tests\cpp-tests\proj.android-studio\app -j4 NDK_MODULE_PATH=D:
\cocos2d-x-3.14.1;D:\cocos2d-x-3.14.1\cocos;D:\cocos2d-x-3.14.1\external NDK_TOO
LCHAIN_VERSION=4.9 NDK_DEBUG=1'
Android NDK: WARNING: Ignoring unknown import directory: D:\cocos2d-x-3.14.1
Android NDK: jni/Android.mk: Cannot find module with tag 'cocos' in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:
make: Entering directory `D:/cocos2d-x-3.14.1/tests/cpp-tests/proj.android-studi
o/app'
jni/Android.mk:170: *** Android NDK: Aborting. . Stop.
make: Leaving directory `D:/cocos2d-x-3.14.1/tests/cpp-tests/proj.android-studio
/app'
Error running command, return code: 2.
I’m using:
Windows 7
Android Studio 2.2.3.
Cocos2d-x 3.14.1
Python 2.7.13
Ant 1.10.1
NDK r13b
Any solution for this please?
@slackmoehrle Hi, sorry for the lack of information. I’m trying to run the cpp-tests sample project packed with the cocos2d-x 3.14.1 on Android Studio. Here is the Android.mk of proj.android-studio:
Finally, I fixed it by uninstall everything, delete all Environment Variable and set it all up from the beginning for 3 or 4 times. I also move cocos2d-x 3.14.1 to another folder( from D:\cocos2d-x 3.14.1 to D:\cocos2d-x\cocos2d-x 3.14.1).
And that fixed it, I still have no idea why but I’m pretty sure everything is the same.
Hi!
I have a similar problem. It works with version 3.13.1 and the same problem with 3.14.1+ (github).
Could you say what exactly you are have reinstalled?
Deleting the cocos2d-x 3.14.1 folder. Download it again, unzip and put it into another folder likes I said above.
Deleting all the evironment variables created by the setup.py : ANDROID_SDK_ROOT, ANT_ROOT, COCOS_CONSOLE_ROOT, COCOS_TEMPLATE_ROOT, COCOS_X_ROOT, NDK_ROOT.
Removing their path in the PATH varible , which is :C:\Python27;D:\apache-ant-1.10.1\bin and D:\cocos2d-x\cocos2d-x-3.14.1\templates;D:\cocos2d-x\cocos2d-x-3.14.1\tools\cocos2d-console\bin in my PC.
Restart my PC ( I saw some guide said that it’s neccessary to restart the computer after environment variable change)
Then I following all the step here : http://www.cocos2d-x.org/docs/installation/Android-terminal/index.html . Make sure you do it step by step and check whether the ant and python command works in command line. Take note that the path to ANT_ROOT should be D:\apache-ant-1.10.1\bin instead of D:\apache-ant-1.10.1 (replace the path to apache with your corresponding path). And restart your PC after setting up your environment variables with setup.py with all correct path.
I don’t know how this work for me but it’s worth a try
I recently rewrote these instructions but they have not been deployed because I need to do a final test on Windows. I will deploy they soon. Those that I asked said the new version was way better to comprehend.
But I do not think that the problem in Environment variables. I can work with version 3.13.1 in Visual Studio and Eclipse.
I thought that the reason may be in conflict of versions of JDK, SDK, NDK… or cocos 3.14.1.
Now I think that the problem in 3.14.1+ from github.
I will try the latest version tomorrow and will tell you about the results.
I also noticed that download-deps.py does not ask me any more if I want to save the zip file or not.
And the creation of a new project seems to be faster than usual.
I apologize for using @sinhviencodon 's topic, but it seemed to me that his problem was caused by the fact that the first time he downloaded the latest version as I did, and then used the 3.14 tag for downloading and everything was fine. Just my guess though.
@slackmoehrle Help please!
I planned release on next week. And I really need a fresh version with the fixed audio engine.