Debug cocos2d-x


#1

Hi all,
What the best way debug android for win 7?
I can build and run with ndk-build
But i cant debug use Android Native Application, when i debug, has error:

[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] Android
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] NDK:
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] jni/Android.mk:
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] Cannot
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] find
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] module
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] with
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] tag
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] ‘CocosDenshion/android’
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] in
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] import
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] path
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo]
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo]
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo]
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo]
Android
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] NDK:
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] Are
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] you
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] sure
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] your
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] NDK_MODULE_PATH
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] variable
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] is
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] properly
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] defined
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] ?
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo]
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo]
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo]
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo]
Android
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] NDK:
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] The
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] following
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] directories
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] were
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] searched:
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo]
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo]
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo]
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo]
Android
[2013-03-09 11:24:35 - TestDemo] Unknown Application ABI:
[2013-03-09 11:24:35 - TestDemo] NDK:
[2013-03-09 11:24:35 - TestDemo] Unable to detect application ABI’s


Problems running test projects
#2

I am getting same error, too.

I did “Debug as…” -> “Android Native Application”.

Can anyone solve it?

Thank you. _b


#3

I tried as well but ended up using either xCode or Visual Studio for debugging.


#4

You may want to check the folloeing points:

  • Go to Preferences~~>Android~~>NDK and make sure you have entered the correct path for your NDK
  • Check your eclipse installation and remove the Sequoyah plugin, or start with a clean eclipse + Android ADT plugin
  • Check your Application.mk and compile for only one architecture (i.e. add APP_ABI=armeabi) AND compile your native code with debugging enabled (add NDK_DEBUG=1 to the build command in eclipse)

#5

I am also facing the same issue, I have a cocos2d-x project, I am using eclipse as IDE
If I clean it gives the following problem, If I delete the error on right click on it in problems window the error disappears.

If I debug it as Native Application, it gives the following error.
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] Android
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] NDK:
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] jni/Android.mk:
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] Cannot
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] find
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] module
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] with
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] tag
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] ‘CocosDenshion/android’
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] in
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] import
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] path
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject]
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject]
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject]
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject]
Android
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] NDK:
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] Are
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] you
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] sure
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] your
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] NDK_MODULE_PATH
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] variable
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] is
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] properly
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] defined
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] ?
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject]
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject]
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject]
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject]
Android
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] NDK:
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] The
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] following
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] directories
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] were
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] searched:
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject]
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject]
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject]
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject]
Android
[2013-04-22 16:51:02 - MyDummyProject] Unknown Application ABI:
[2013-04-22 16:51:02 - MyDummyProject] NDK:
[2013-04-22 16:51:02 - MyDummyProject] Unable to detect application ABI’s

The above mentioned solution doesn’t work for me :frowning:

please help If some can. :slight_smile:


#6

Faced same problems. Ended up using Visual Studio. Its much faster to compile, build and debug in visual studio.


#7

did u solved it?I got same error too …:frowning:


#8

This is caused by Environment settings, it complains cannot found cocos2dx modules and asking u set them in NDK_MODULE_PATH.

two approaches there are:
before u start, u have to build yr project with “NDK_DEBUG=1 NDK_LOG=1” and change Debuggable to true in AndroidManifest.xml.
and then install to the device.

  1. debug in command line:
    in /proj.android/ , run ./ndkgdb.sh to launch the app with debugger. and then u can operate anything as you can in GDB.

  2. debug with Eclipse. (also doing below in command line / terminal)
    a) modify your environment setting, to add a new variable NDK_MODULE_PATH set it point to yr cocos2d-x path (reference to ./ndkgdb.sh) and then run Eclipse
    eg:
    export COCOS2DX_ROOT=~/develop/cocos2d-2.1rc0-x-2.1.2
    export NDK_MODULE_PATH=$COCOS2DX_ROOT:$COCOS2DX_ROOT/cocos2dx/platform/third_party/android/prebuilt
    <Eclipse_path>/eclipse
    b) open your project and setup yr breakpoints, and then “Debug As Android Native App…”

everything should be fine. both are tested in MacOSX. please adapt by yourself if you r using other OS.


#9

I have a simple solution for this error. Took me too long to get to it after digging out days in google.

Just add the NDK_MODULE_PATH from ndkgdb.sh file to Android.mk using $(call import-add-path,XXX)

For example - NDK_MODULE_PATH is: ${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt
Resolved path is:
/Users/XXXX/code/sb-android-git/cocos2d-x-2.2.3:/Users/XXXX/code/sb-android-git/cocos2d-x-2.2.3/cocos2dx/platform/third_party/android/prebuilt

So this is what I added to android.mk:
$(call import-add-path,/Users/XXXX/code/sb-android-git/cocos2d-x-2.2.3)
$(call import-add-path,/Users/XXXX/code/sb-android-git/cocos2d-x-2.2.3/cocos2dx/platform/third_party/android/prebuilt)

To simplify things, this should work on most cases:
$(call import-add-path,$(LOCAL_PATH)/…/…/…/…)
$(call import-add-path,$(LOCAL_PATH)/…/…/…/…/cocos2dx/platform/third_party/android/prebuilt)

Hope I helped!
A.