Python android-build.py -p 19 cpp-tests fails

Please help with a newbie issue here. Thanks!

Please answer these questions to help fix this issue:
What’s the issue?
python android-build.py -p 19 cpp-tests fails
What’s the engine version?
not sure
How to reproduce it?
“python android-build.py -p 19 cpp-tests” under windows 7 command line

Here is the output:

D:\android\cocos2d-x-3\build>python android-build.py -p 19 cpp-tests
The Selected NDK toolchain version was 4.8 !
d:\android\android-ndk-r9d\ndk-build -j4 -C D:\android\cocos2d-x-3\build…\tests/cpp-tests/proj.android NDK_MODULE_PATH=D:\android\cocos2d-x-3\build…;D:\android\cocos2d-x-3\buil
d…/external;D:\android\cocos2d-x-3\build…/cocos
Android NDK: D:\android\cocos2d-x-3\build…/cocos/./Android.mk: Cannot find module with tag ‘freetype2/prebuilt/android’ 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.exe: Entering directory D:/android/cocos2d-x-3/tests/cpp-tests/proj.android' D:\android\cocos2d-x-3\build\../cocos/./Android.mk:208: *** Android NDK: Aborting. . Stop. make.exe: Leaving directoryD:/android/cocos2d-x-3/tests/cpp-tests/proj.android’
Build dynamic library for project [ D:\android\cocos2d-x-3\build…\tests/cpp-tests/proj.android ] fails!

I got the same problem on Ubuntu 14.04

dungtruong@ubuntu:~/Sources/cocos2d-x/build$ python android-build.py -p 19 cpp-tests The Selected NDK toolchain version was 4.8 ! Can't know cpuinfo, use default 1 cpu /home/dungtruong/Libraries/android-ndk-r9d/ndk-build -j1 -C /home/dungtruong/Sources/cocos2d-x/build/../tests/cpp-tests/proj.android NDK_MODULE_PATH=/home/dungtruong/Sources/cocos2d-x/build/..:/home/dungtruong/Sources/cocos2d-x/build/../external:/home/dungtruong/Sources/cocos2d-x/build/../cocos Android NDK: /home/dungtruong/Sources/cocos2d-x/build/../cocos/./Android.mk: Cannot find module with tag 'freetype2/prebuilt/android' 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/home/dungtruong/Sources/cocos2d-x/tests/cpp-tests/proj.android’
/home/dungtruong/Sources/cocos2d-x/build/…/cocos/./Android.mk:208: *** Android NDK: Aborting. . Stop.
make: Leaving directory /home/dungtruong/Sources/cocos2d-x/tests/cpp-tests/proj.android' Build dynamic library for project [ /home/dungtruong/Sources/cocos2d-x/build/../tests/cpp-tests/proj.android ] fails!

@dungtruong This happened on version 3.0

You need to add the path to the top directory containing the freetype2 directory.
Use import-add-path or NDK_MODULE_PATH to do it.

OK I got it. Previously when I was trying to download cocos2d-x, I was somehow led to a currently developing page and downloaded cocos2d-x-3.zip, which is incomplete. I now downloaded cocos2d-x-3.0.zip from http://www.cocos2d-x.org/download. The file is much larger. The same build command is running through a whole bunch of cpp files right now. There are some warnings on “%ld” etc. Hope it will finish by the morning. :slight_smile:

Presumably the long build process is just a one time deal?

this problem seems to be embedded in all cocos versions
i have tried android-build py in version 3.15.1 and manually building in version 2.7 and i got the same issue, it will be great help if you explain more about this. thanks

if you meant editing android.mk file, i’ve even edited the default “$call (import-module,cocos)” to “$call (import-add-path,cocos)” and got this error
Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 9
in ./AndroidManifest.xml
Android NDK: WARNING: Ignoring unknown import directory: c:\cocos2d-x-3.15.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 c:/cocos2d-x-3.15.1/tests/cpp-tests/proj.android' jni/Android.mk:153: *** Android NDK: Aborting. . Stop. make: Leaving directoryc:/cocos2d-x-3.15.1/tests/cpp-tests/proj.android’
Error running command, return code: 2.
Build dynamic library for project [ c:\cocos2d-x-3.15.1\build…\tests\cpp-tests ] failed!