Can't Use ndk-gdb to Debug Cocos2d-x : CPU ABIs not Support

Hi,

I’m just a beginner for cocos2d-x.

I created a sample project with create-android-project.bat, built it with build_native.sh, imported the project in Eclipse, and successfully ran it on both Emulator and my Galaxy Nexus.

But I got an error when I wanted to use ndk-gdb to debug it:

$ /cygdrive/D/dev/android-ndk-r8e/ndk-gdb —adb=/cygdrive/D/dev/adt-bundle-wind
ows-x86_64-20130219/sdk/platform-tools/adb.exe -s emulator-5556
/cygdrive/D/dev/android-ndk-r8e/build/core/add-application.mk:128: Android NDK:
WARNING: APP_PLATFORM android-14 is larger than android:minSdkVersion 8 in ./And
roidManifest.xml
jni/Android.mk:19: * Android NDK: Aborting. 。 停止。
ERROR: The device does not support the application’s targetted CPU ABIs!
Device supports: armeabi-v7a armeabi
Package supports: Android NDK:

I searched a lot of document but still can’t make it work. I’ve already set “APP_ABI := armeabi-v7a” in Application.mk, still got the error message.
This problem drives me crazy. I’ll be grateful if anyone can help.

My env:
OS: Win8
Cocos2d-x: cocos2d-2.1rc0-x-2.1.3
ADT: adt-bundle-windows-x86_64-20130219
NDK: android-ndk-r8e
Cygwin: 1.7.18-1

Thanks.

I’ve met the same problem…and had no idea to solve it either. Now I could only send this question to the top and wait for the answer…

I’ve been able to get it working and didn’t encounter this problem. I’m using a Nexus 7 tablet with “APP_ABI := armeabi-v7a” in the Application.mk file. I’m using adt version 21.0.0.v201210310015-519525 and NDK r8b. My android-sdk platform folder contains “android-15/16/17” folders and my NDK platform folder contains “android-3/4/5/8/9/14” folders.

I would suggest trying to build using “APP_ABI := armeabi” instead of armeabi-v7a and see if anything changes. You could also do a grep on your folders and search for “armeabi” and try to make sure all of them are armeabi instead of armeabi-v7a.

Here is the guide that I used to get debugging working in eclipse.

Here is a stackoverflow that may be related:

Feel free to ask me for any further info since my build is working with ndk-gdb.

Kevin H wrote:

I’ve been able to get it working and didn’t encounter this problem. I’m using a Nexus 7 tablet with “APP_ABI := armeabi-v7a” in the Application.mk file. I’m using adt version 21.0.0.v201210310015-519525 and NDK r8b. My android-sdk platform folder contains “android-15/16/17” folders and my NDK platform folder contains “android-3/4/5/8/9/14” folders.
>
I would suggest trying to build using “APP_ABI := armeabi” instead of armeabi-v7a and see if anything changes. You could also do a grep on your folders and search for “armeabi” and try to make sure all of them are armeabi instead of armeabi-v7a.
>
Here is the guide that I used to get debugging working in eclipse.
http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-debugging/
>
Here is a stackoverflow that may be related:
http://stackoverflow.com/questions/8714671/galaxy-nexus-wrong-cpu-abi-being-selected-during-install-time
>
Feel free to ask me for any further info since my build is working with ndk-gdb.

First, Thank you for your help. And I’ve reset my environment by following the tutorials which you gave. It seems could work, but at last the console in the eclipse reprot another error….“error,msg=”localhost:5039 23\311\323\332\301\254\275\323\267\275\324 …“(here is too long…and all with these numbers…I think it’s the problem of coding format) And the messagebox shows”Target selection failed." Now I’m still trying to fix these problems. If you know how to deal with them, please reply me. Thank you once again!

I’ve not encountered this message before. Make sure you followed steps 9 and 10 from the tutorial I linked.

After following the tutorial to setup eclipse I am able to debug using the following steps:
First (this step needs to be ran every time new files are added),

  1. Launch the app in debug mode.
  2. Open cygwin terminal, cd to proj.android folder, and run ndk-gdb
  3. Quit app, copy obj/local/armeabi/gdb.setup as gdb2.setup
  4. Open gdb2.setup in notepad and remove the “target remote :5039” line if it exists

Next,

  1. Launch the app in debug mode.
  2. Open cygwin terminal, cd to proj.android folder, and run ndk-gdb-eclipse
  3. In eclipse switch to the “C/C**" view, right click the project name > Debug As > Debug Configurations…
  4. Under "C/C** Application” click the project name and click the Debug button.

The following link may help:
https://groups.google.com/forum/?fromgroups=#!topic/android-ndk/wdONYr5IRMI

Are you able to run the app in debug mode from eclipse at all?
If yes, when you run ndk-gdb from terminal does it give errors?

Kevin H wrote:

I’ve not encountered this message before. Make sure you followed steps 9 and 10 from the tutorial I linked.
>
After following the tutorial to setup eclipse I am able to debug using the following steps:
First (this step needs to be ran every time new files are added),

  1. Launch the app in debug mode.
  2. Open cygwin terminal, cd to proj.android folder, and run ndk-gdb
  3. Quit app, copy obj/local/armeabi/gdb.setup as gdb2.setup
  4. Open gdb2.setup in notepad and remove the “target remote :5039” line if it exists
    >
    Next,
  5. Launch the app in debug mode.
  6. Open cygwin terminal, cd to proj.android folder, and run ndk-gdb-eclipse
  7. In eclipse switch to the “C/C**" view, right click the project name > Debug As > Debug Configurations…
  8. Under "C/C** Application” click the project name and click the Debug button.
    >
    The following link may help:
    https://groups.google.com/forum/?fromgroups=#![](topic/android-ndk/wdONYr5IRMI

Are you able to run the app in debug mode from eclipse at all?
If yes, when you run ndk-gdb from terminal does it give errors?

Well, by your suggestion and reading the tutorials carefully, finally, I can debug the android-ndk sample on the AVD. I really thank you so much) It seems the previous problems are caused by the ndk-gdb script.
I want to debug on my cell-phone before, but when I run ndk-gdb in cygwin, the console shows “ERROR: Could not extract package’s data directory. Are you sure that your installed application is debuggable?” And someone said that was caused by DATA_DIR in the ndk-gdb script, so I defined an absolute path for it.
But after solve this problem of ndk debug, I found I’m back to the origin…Can’t Use ndk-gdb to Debug Cocos2d-x : CPU ABIs not Support…and this only happened in cocos2d-x case which is debuged on my cell-phone.(the cocos2d-x case can’t be debuged on AVD because AVD don’t have OpenGL2.0) By comparing with your environment, the difference is that I use NDK r8d, cocos2d-x-2.0.4 and my cell-phone is MEIZU MX with android 4.1.1(It has been rooted). So maybe that’s all my cell-phone’s fault? Haha…Anyway, thank you for your help!

That is good to hear! If you are able to debug with the simulator I guess that is good enough. =) The stackoverflow page that I linked mentioned your particular phone model and a bug with regards to the APP_ABI setting, which may be something to research if you need phone debugging.

Kevin H wrote:

That is good to hear! If you are able to debug with the simulator I guess that is good enough. =) The stackoverflow page that I linked mentioned your particular phone model and a bug with regards to the APP_ABI setting, which may be something to research if you need phone debugging.

Hoha~I’ve successed! And now I think I should share my experience. In fact, I feel strange, why many people have met this problem, but almost no one could give an absolutely right answer. Or maybe my answer is just suit the specific group as well?
I’ve shared my experience in this link

http://www.cocos2d-x.org/boards/6/topics/28261

Thanks Kevin for your tutorial and thanks Junfeng for your summary, I finally get rid of this problem.
I’ve been suffered by this problem for a few days. Now I feel much better. Thank you very much again!
I’m a rookie of android and cocos2d-x. If any further problem, maybe I’ll go back and ask for your help:)

By the way Junfeng, in your experience post, you give a Chinese tutorial http://www.cocoachina.com/gamedev/gameengine/2012/0428/4206.html
In fact, it’s translated from http://www.raywenderlich.com/33750/cocos2d-x-tutorial-for-ios-and-android-getting-started
You can provide both to support readers of different languages.

Lucky Liu wrote:

Thanks Kevin for your tutorial and thanks Junfeng for your summary, I finally get rid of this problem.
I’ve been suffered by this problem for a few days. Now I feel much better. Thank you very much again!
I’m a rookie of android and cocos2d-x. If any further problem, maybe I’ll go back and ask for your help:)
>
By the way Junfeng, in your experience post, you give a Chinese tutorial http://www.cocoachina.com/gamedev/gameengine/2012/0428/4206.html
In fact, it’s translated from http://www.raywenderlich.com/33750/cocos2d-x-tutorial-for-ios-and-android-getting-started
You can provide both to support readers of different languages.

Haha, I’ve guessed the tutorial in Chinese is a translated one. And I’ve just searched it from net, what I mean is you can search any tutorials which you want and try them one by one until you find one which is the best for you. Only do this, you will find the real trouble in your case.