android ndk调试问题收集

出现问题:

1、

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: jni/Android.mk: Cannot find module with tag 'CocosDenshion/android' in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:

  解决方法:

export NDK_MODULE_PATH=/cygdrive/d/work/qin_all/source/libs/cocos2dx/platform/third_party/android/prebuilt

如果不行,再试:

add to Android.mk in jni folder after "include $(BUILD_SHARED_LIBRARY)"string that:
$(call import-add-path,PATH_TO_YOUR_COCOS_FOLDER)
$(call import-add-path,PATH_TO_YOUR_COCOS_FOLDER/cocos2dx/platform/third_party/android/prebuilt)


2、如何设置断点

    a:在java代码中要进入jni代码出加上语句android.os.Debug.waitForDebugger();  并在此句上设置断点。

    b: 先启动eclipse的 debug as android, 在cygwin中的工程目录中运行 ndk-gdb

    c: 如果ndk-gdb成功,则设置断点 b xx.cpp:90, 设置好后运行 c。

    d:eclipse, 运行继续, 则会跳转到jni的断点处

3、编译命令需要加NDK_DEBUG=1  ;  build_native.sh NDK_DEBUG=1

4、编译不通平台的库,在application.mk 中添加  APP_ABI := armeabi  

你可能感兴趣的:(android ndk调试问题收集)