How to complie cocos2d-1.0.1-x-0.13.0-beta tests with NDK?

I have opened the Cygwin Terminal, changed directory to “cocos2d-1.0.1-x-0.13.0-beta\tests\test.android”. Now I execute the “ndk-build” command. And it failed, it told me that “Android NDK: jni/Android.mk: Cannot find module with tag ‘tests’ in import path”. Anyone knows how to fix it? Thank you very much.

Have you changed COCOS2DX_ROOT_LOCAL to fit your environment?

If you mean this file “cocos2d-1.0.1-x-0.13.0-beta\tests\test.android\build_native.sh”, I did. I changed the NDK_ROOT_LOCAL and the COCOS2DX_ROOT_LOCAL params, but it did not work.

I can complie it with command “./build_native.sh”, but not with “ndk-build”.

You can refer build_native.sh, it sets NDK_MODULE_PATH when using ndk-build.

I have changed the setting in the build_native.sh, but it did not work.

But you said

>> I can complie it with command “./build_native.sh”, but not with “ndk-build”.

And did you use ndk-r7b?

Yes. I use android-ndk-r7b.

I mean that command“./build_native.sh” worked, command“ndk-build” did not work.

Why not use build_native.sh?
If you want to write your own shell script, you should refer build_native.sh.
Make sure you know what build_native.sh did.

I just do not understand that why cocos2d-1.0.1-x-0.12.0 can use “ndk-build” but cocos2d-1.0.1-x-0.13.0-beta can not. Is that a bug? Anyway, thank you very much.

As I said, you should NDK_MODULE_PATH when using ndk-build, the build system will use this path(such as $(call import-module,tests)).

How to set? Need to edit Android.mk file? Sorry about that. I remember that I can use ndk-build in cocos2d-1.0.1-x-0.12.0 without setting NDK_MODULE_PATH.

That’s the reason I suggest you referring build_native.sh

$NDK_ROOT_LOCAL/ndk-build -C $TESTS_ROOT $* \
        NDK_MODULE_PATH=${COCOS2DX_ROOT_LOCAL}:${COCOS2DX_ROOT_LOCAL}/cocos2dx/platform/third_party/android/source

Maybe I should have a try. Thank you very much!