cd Documents/workspace/ndkfoo
我项目的主页
然后我尝试运行ndk-build命令但继续获取
ndk-build
Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: /Users/naveenkumar/workspace/com.gslab.zap:/Users/naveenkumar/Android/android-ndk-r8:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/naveenkumar/Android/android-ndk-r8:/usr/X11/bin:/usr/local/git/bin/jni/Android.mk
我知道APP_BUILD_SCRIPT指向一个不同的地方它应该是/Users/naveenkumar/Documents/workspace/ndkfoo/jni/Android.mk 我在这个地方有我的Android.mk ......
但我不知道如何将APP_BUILD_SCRIPT更改为此路径:(,提前知道
我的Android.mk很好......这是我的Android.mk,它位于项目的jni文件夹下:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#here we give our module name and source files.
LOCAL_MODULE := ndkfoo
LOCAL_SRC_FILES := ndkfoo.c
include $(BUILD_SHARED_LIBRARY)
当我用NDK_LOG = 1运行它时,我得到以下
NAVEEN-KUMARs-MacBook-Pro:ndkfoo naveenkumar$ /Users/naveenkumar/Downloads/android-ndk-r8/ndk-build NDK_LOG=1
HOST_OS=darwin
HOST_ARCH=x86_64
HOST_TAG=darwin-x86 (no 64-bit prebuilt binaries detected)
GNUMAKE=/Users/naveenkumar/Downloads/android-ndk-r8/prebuilt/darwin-x86/bin/make (NDK prebuilt)
Android NDK: NDK installation path auto-detected: '/Users/naveenkumar/Downloads/android-ndk-r8'
Android NDK: GNU Make version 3.81 detected
Android NDK: Host OS was auto-detected: darwin
Android NDK: Host operating system detected: darwin
Android NDK: Host CPU was auto-detected: x86
Android NDK: HOST_TAG set to darwin-x86
Android NDK: Host tools prebuilt directory: /Users/naveenkumar/Downloads/android-ndk-r8/prebuilt/darwin-x86/bin
Android NDK: Host 'echo' tool: echo
Android NDK: Host 'awk' tool: /Users/naveenkumar/Downloads/android-ndk-r8/prebuilt/darwin-x86/bin/awk
Android NDK: Host 'awk' test returned: Pass
Android NDK: This NDK supports the following target architectures and ABIS:
Android NDK: arm: armeabi armeabi-v7a
Android NDK: mips: mips
Android NDK: x86: x86
Android NDK: This NDK supports the following toolchains and target ABIs:
Android NDK: arm-linux-androideabi-4.4.3: armeabi armeabi-v7a
Android NDK: mipsel-linux-android-4.4.3: mips
Android NDK: x86-4.4.3: x86
Android NDK: Found platform root directory: /Users/naveenkumar/Downloads/android-ndk-r8/platforms
Android NDK: Found supported platforms: android-14 android-3 android-4 android-5 android-8 android-9
Android NDK: PLATFORM android-14 supports: arm mips x86
Android NDK: ABI arm sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-14/arch-arm
Android NDK: ABI mips sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-14/arch-mips
Android NDK: ABI x86 sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-14/arch-x86
Android NDK: PLATFORM android-3 supports: arm mips x86
Android NDK: ABI arm sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-3/arch-arm
Android NDK: ABI mips sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-3/arch-mips
Android NDK: ABI x86 sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-3/arch-x86
Android NDK: PLATFORM android-4 supports: arm mips x86
Android NDK: ABI arm sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-4/arch-arm
Android NDK: ABI mips sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-4/arch-mips
Android NDK: ABI x86 sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-4/arch-x86
Android NDK: PLATFORM android-5 supports: arm mips x86
Android NDK: ABI arm sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-5/arch-arm
Android NDK: ABI mips sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-5/arch-mips
Android NDK: ABI x86 sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-5/arch-x86
Android NDK: PLATFORM android-8 supports: arm mips x86
Android NDK: ABI arm sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-8/arch-arm
Android NDK: ABI mips sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-8/arch-mips
Android NDK: ABI x86 sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-8/arch-x86
Android NDK: PLATFORM android-9 supports: arm mips x86
Android NDK: ABI arm sysroot is: /Users/naveenkumar/Downloads/android-ndk- r8/platforms/android-9/arch-arm
Android NDK: ABI mips sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-9/arch-mips
Android NDK: ABI x86 sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-9/arch-x86
Android NDK: Found stable platform levels: 14 3 4 5 8 9
Android NDK: Found max platform level: 14
Android NDK: Found project path: /Users/naveenkumar/workspace/com.gslab.zap:/Users/naveenkumar/Android/android-ndk-r8:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/naveenkumar/Android/android-ndk-r8:/usr/X11/bin:/usr/local/git/bin
Android NDK: Ouput path: /Users/naveenkumar/workspace/com.gslab.zap:/Users/naveenkumar/Android/android-ndk-r8:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/naveenkumar/Android/android-ndk-r8:/usr/X11/bin:/usr/local/git/bin/obj
Android NDK: Parsing /Users/naveenkumar/Downloads/android-ndk-r8/build/core/default-application.mk
Android NDK: Defaulted to APP_PLATFORM=android-3
Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: /Users/naveenkumar/workspace/com.gslab.zap:/Users/naveenkumar/Android/android-ndk-r8:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/naveenkumar/Android/android-ndk-r8:/usr/X11/bin:/usr/local/git/bin/jni/Android.mk
/Users/naveenkumar/Downloads/android-ndk-r8/build/core/add-application.mk:133: *** Android NDK: Aborting... . Stop.
正如我们可以看到我是主目录..但它仍然需要错误,我的Application.mk也放在jni下面,所以我尝试在Application.mk中粘贴这三行
APP_PROJECT_PATH := /Users/naveenkumar/Documents/workspace/ndkfoo
APP_BUILD_SCRIPT := /Users/naveenkumar/Documents/workspace/ndkfoo/jni/Android.mk
APP_MODULES := ndkfoo
目录结构如下:现在因为我能够运行一次所以它有.o和它生成的其他库......
NAVEEN-KUMARs-MacBook-Pro:工作空间naveenkumar $ find ndkfoo / -type f
ndkfoo//.classpath
ndkfoo//.project
ndkfoo//AndroidManifest.xml
ndkfoo//bin/classes/com/gslab/ndkdemo/BuildConfig.class
ndkfoo//bin/classes/com/gslab/ndkdemo/NDKFooActivity.class
ndkfoo//bin/classes/com/gslab/ndkdemo/R$attr.class
ndkfoo//bin/classes/com/gslab/ndkdemo/R$drawable.class
ndkfoo//bin/classes/com/gslab/ndkdemo/R$layout.class
ndkfoo//bin/classes/com/gslab/ndkdemo/R$string.class
ndkfoo//bin/classes/com/gslab/ndkdemo/R.class
ndkfoo//bin/classes.dex
ndkfoo//bin/ndkfoo.apk
ndkfoo//bin/res/drawable-hdpi/icon.png
ndkfoo//bin/res/drawable-ldpi/icon.png
ndkfoo//bin/res/drawable-mdpi/icon.png
ndkfoo//bin/resources.ap_
ndkfoo//gen/com/gslab/ndkdemo/BuildConfig.java
ndkfoo//gen/com/gslab/ndkdemo/R.java
ndkfoo//jni/Android.mk
ndkfoo//jni/Application.mk
ndkfoo//jni/ndkfoo.c
ndkfoo//libs/armeabi/libndkfoo.so
ndkfoo//obj/local/armeabi/libndkfoo.so
ndkfoo//obj/local/armeabi/objs/ndkfoo/ndkfoo.o
ndkfoo//obj/local/armeabi/objs/ndkfoo/ndkfoo.o.d
ndkfoo//proguard.cfg
ndkfoo//project.properties
ndkfoo//res/drawable-hdpi/icon.png
ndkfoo//res/drawable-ldpi/icon.png
ndkfoo//res/drawable-mdpi/icon.png
ndkfoo//res/layout/main.xml
ndkfoo//res/values/strings.xml
ndkfoo//src/com/gslab/ndkdemo/NDKFooActivity.java
这不是未找到的构建脚本的重复,因为我指向正确的构建路径并且触发了cmake。
答案 0 :(得分:1)
引自此来源:https://groups.google.com/forum/#!topic/android-ndk/HIUR2gL6Xj0
构建系统试图找到 通过反向跟踪目录来获取AndroidManifest.xml。看起来像 它在/home/myhome/AndroidManifest.xml下找到了一个,并认为这是 项目路径的根。我认为这与另一个相对应 (可能是陈旧的)项目,而不是你想要工作的项目。
尝试从包含你的目录调用ndk-build 而不是AndroidManifest.xml
我认为你在这里有类似的问题。