cocos2Dx android test Crash

hy every one.
i’m trying to run the test case like [[http://www.cocos2d-x.org/projects/cocos2d-x/wiki/How_to_run_test_cases_on_android-ndk]]
but when i’n starting to run on the emulator the application crash with this message “the application test (process org.cocos2dx.test) as stopped unexpectedly. please try again”

y run the NDK sample jni and it work.
i’m using android-ndk-r5 and the cocos2d-1.0.0-x-0.9.0

there is some console message

[2011-07-20 16:26:59 - TestsDemo] WARNING: Application does not specify an API level requirement!
[2011-07-20 16:26:59 - TestsDemo] Device API version is 10 (Android 2.3.3)
[2011-07-20 16:26:59 - TestsDemo] Uploading TestsDemo.apk onto device ‘emulator-5554’
[2011-07-20 16:28:18 - TestsDemo] Installing TestsDemo.apk…
[2011-07-20 16:28:25 - TestsDemo] Success!
[2011-07-20 16:28:25 - TestsDemo] Starting activity org.cocos2dx.tests.TestsDemo on device emulator-5554
[2011-07-20 16:28:26 - TestsDemo] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=org.cocos2dx.tests/.TestsDemo }

i’am certainly doing something wrong but i cant find it.
some one have a clue?

thx
Eddie

  1. Have you build .so
    Go to tests/test.android/libs/armeabi/, check if there are libchipmunk.so, libbox2d.so, libcocos2d.so and libtests.so.

  2. Have you packed the .so into apk
    Goto tests/test.android/bin, open the apk file with WinRar to check if the .so are packed into it.

  3. Does the resources copied into assets
    Goto tests/test.android/assets, and check the resource.

thx for your fast answer.

  1. & 2. no i haven’t build .so how can i do that ?

3 yes resources are into assests

run tests/test.android/build_native.sh in cygwin

that’s the way i do the build but the libchipmunk.so, libbox2d.so, libcocos2d.so and libtests.so are not here.

Oh, you should modify the .sh to run in your environment.
Modify ANDROID_NDK_ROOT and COCOS2DX_ROOT.

i have do it to this way but the libs/armeabi only contains

gdb.setup
gdbserver

the test demo.apk is 7447ko and the lib are not here.
also if the ressources are here that’s mean i don’t make a mistake on ANDROID_NDK_ROOT and COCOS2DX_ROOT path i think.

i’m realy stuck. i am going to do som other test by Create project methode.
thank you for your help.

ok so i have maque a mistake on my Android.mk so the nk don’t go to the library
bur now i have an other problem see the image

What’s your Android.mk look like?
Is APP_STL := stlport_static in your Application.mk?

Yes
application.mk

APP_STL := stlport_static
APP_ABI := armeabi armeabi-v7a

APP_MODULES := cocos2d cocosdenshion chipmunk box2d tests

there is also my android.mk

What’s the version of cygwin, have you builded samples afforded by ndk?
Google says that, ther cynwin version should be 1.7 or above.

i have the last version of cygwin 1.7.5
and i have done the test of jni and it’s ok

my previous build of the test.android i comment the LOCAL_LDLIBS and it build well (the application crashed beacose of that)

I am sorry, I am confused.
Now, what is your problem?

Sorry it’s a litle bit confusing i know. ( maybe i have to do it on an other post)

my previous problem isn’t resolved because now i can’t build the test application.

In fact beafore in my Android.mk i have comment the r5 LOCAL_LDLIBS (so the application build but crash on the emulator because the library aren’t on the package).

but when i uncomment it i can’t build the application (like you saw it on my screen cocos2Dx_Error.jpg )
the r4 LOCAL_LDLIBS are commented.

1 Like

Have you modified something?
And what’s your version of cocos2d-x?

no i haven’t, i think im’ going to run some other test.
my version is cocos2d-1.0.0-x-0.9.0.

the build_native.sh of the test.android and when un create my own project (use the create-android-project.bat ) isn’t the same.

my own

ANDROID_NDK_ROOT=/cygdrive/c/android-ndk-r5
COCOS2DX_ROOT=/home/eddie/cocos2d
GAME_ROOT=$COCOS2DX_ROOT/androidbuild
GAME_ANDROID_ROOT=$GAME_ROOT/android
RESOURCE_ROOT=$GAME_ROOT/Resource

test.android

ANDROID_NDK_ROOT=/cygdrive/c/android-ndk-r5
COCOS2DX_ROOT=/cygdrive/c/cygwin/home/eddie/cocos2d
TESTS_ROOT=$COCOS2DX_ROOT/tests/test.android

Also i run an other test by creating my own application.
the libchipmunk.so, libbox2d.so, libcocos2d.so and libtests.so. aren’t in the file.

just a question do i have to enter a specific name of package when i create my project ( mine is com.androidex);

Yes, your should modify build_native.sh to run in your environment.
What’s your root of cocos2dx.
Which is correct?

i modify build_native.sh but don’t really know if do it well. ??

cocos2dx is one the cygwin repertory in home/eddie

so the both are ok i gess

COCOS2DX_ROOT=/home/eddie/cocos2d
or
COCOS2DX_ROOT=/cygdrive/c/cygwin/home/eddie/cocos2d

maybe the test is not updated with the new cocos2d-1.0.0-x-0.9.0.
but that’s not resolved my own project’s crash (helloworld).

They are tested before releasing.
I am sorry, I don’t know what’s your problem.

I suggest you redownload the cocos2dx, and run it.
May be you modified something you forgot.