问题
I am trying to get ndk-gdb to work but I have some problems.
My project structure is something like this:
trunk
--indiana (Here is the android_manifest)
--ubravo_java
----mbravo (here is the native code)
------jni (here are the Android.mk and Application.mk)
Question 1: I understand that I probably have to run ndk-gdb from the directory where the manifest is located correct? Or I provide the --project parameter to the ndk-gdb command.
So if I try to launch the ndk-gdb like this:
ndk-gdb --start --force --verbose --project=/home/johan/projects/indiana2/trunk/indiana
I get this output which to me indicates that it is tryin to find the Android.mk directly in the subfolder of the main project where the android_manifest file is located but I might be wrong.
Android NDK installation path: /home/johan/android-ndk-r7
Using default adb command: /home/johan/android-sdk-linux/platform-tools//adb
ADB version found: Android Debug Bridge version 1.0.29
Using final ADB command: '/home/johan/android-sdk-linux/platform-tools//adb'
Using specified project path: /home/johan/projects/indiana2/trunk/indiana
Found package name: net.genaker.indiana
/home/johan/android-ndk-r7/build/core/add-application.mk:133: *** Android NDK: Aborting... . Stop.
ABIs targetted by application: Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: ./jni/Android.mk
Device API Level: 10
Device CPU ABIs: armeabi-v7a armeabi
ERROR: The device does not support the application's targetted CPU ABIs!
Device supports: armeabi-v7a armeabi
Package supports: Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: ./jni/Android.mk
My APP_BUILD_SCRIPT path in Application.mk looks like this:
APP_BUILD_SCRIPT := $(APP_PROJECT_PATH)/jni/Android.mk
But here I am not sure what the APP_PROJECT_PATH is referring to. I have also tried to hardcode the full path to the Android.mk file like /home/johan/projects/... etc but the error still comes out with:
Your APP_BUILD_SCRIPT points to an unknown file: ./jni/Android.mk
so it seems as the path is not changed like it is not even looking at my Application.mk.
I have tried to search the full trunk dir for references to APP_PROJECT_PATH and this parameter is only defined in this folder in this Application.mk. I just assume that I am able to create a project and debug it without having the /jni folder as a subfolder directly underneath the folder which contains the manifest file right?
Any hints appreciated on how to get the debugging working.
回答1:
I have met same problem today, and my solution is to excute below script before build-native.sh: export NDK_PROJECT_PATH=[your project folder]/android (please note you must use absolute path)
and it works then. I guess you could hardcode the APP_PROJECT_PATH in Application.mk, it should be same.
来源:https://stackoverflow.com/questions/9359568/your-app-build-script-points-to-an-unknown-file-jni-android-mk