throw error in private 'static native void nativeSetApkPath(final String pApkPath)'

throw error in private 'static native void nativeSetApkPath(final String pApkPath)'
0.0 0


hello~ I’m really enjoying cocos2dx in these days.

I’ve made tiny game with VS2010. It was compiled well and could run as win32 program.

I have a problem with porting to android.
using create_android_project.bat, latest cygwin, the game source compiled well. but, open the project with eclipse and debugging… throw an error at the nativeSetApkPath method line.( i’ve break point there )

I’ve check the file and assets in the apk package.
thank you.


Hi, Lee Seulki:
I falled cross the same question as you descripted,I wonder whether you solved the problem.
My cocos2d-x version is cocos2d-2.0-x-2.0.4, and i just compile and run the TestCpp demo.
PS: in my local enviroment, i hava compile and run tests demo of version cocos2d-2.0-rc2-x-2.0.1 well.

thank you!


hi! sheng wu ~!
It was not solved yet :frowning:
anyway if i got something useful information i’ll share with u.


Hi, Lee Seulki:
My TestCpp had run in the phone successfully, but i have no idea about the reason~.

All i have done is chaning a new compilation method.

In the iffy case, i runned the “” in the “.android” directory in Cygwin enviroment, and runned the android project in eclipse. it did not work, and you known the representation.

In the working case, i added a new builder for the android project in eclipse(right click the project—>properties—>Builders—>New). There are two places which need to set.
(1) Main. the Location sets as “F:-ndk-r8b-windows\android-ndk-r8b\ndk-build.cmd”, and the “Working Directory” sets as “${workspace_loc:/TestCpp}”.
(2) Enviroment. You need add a item, the “Variable” sets as “NDK_MODULE_PATH”, and the “Value” sets as “F:2d-x\cocos2d-2.0-x-2.0.4\cocos2d-2.0-x-2.0.4;F:2d-x\cocos2d-2.0-x-2.0.4\cocos2d-2.0-x-2.0.4\cocos2dx\platform\third_party\android\prebuilt”.

You can try it, and wish you success.

BTW, if you know the reason, please let me know.


You may lose below code in your Activity

static {