"你的 APP_BUILD_SCRIPT 指向一个未知的文件:./ jni/Android.mk"

发布时间: 2015/4/21 22:39:48
注意事项: 本文中文内容可能为机器翻译,如要查看英文原文请点击上面连接.

我搜索 (我认为) 的全网。和它说什么过,尝试过,但没有运气仍然不工作。im 测试它在 cygwin 下和在 windows 下
这是项目的我的文件/目录:

D:\Java_2\workspace_indigo\JniTest\.classpath
D:\Java_2\workspace_indigo\JniTest\.project
D:\Java_2\workspace_indigo\JniTest\AndroidManifest.xml
D:\Java_2\workspace_indigo\JniTest\assets
D:\Java_2\workspace_indigo\JniTest\bin
D:\Java_2\workspace_indigo\JniTest\files
D:\Java_2\workspace_indigo\JniTest\gen
D:\Java_2\workspace_indigo\JniTest\native
D:\Java_2\workspace_indigo\JniTest\proguard.cfg
D:\Java_2\workspace_indigo\JniTest\project.properties
D:\Java_2\workspace_indigo\JniTest\res
D:\Java_2\workspace_indigo\JniTest\src
D:\Java_2\workspace_indigo\JniTest\bin\classes
D:\Java_2\workspace_indigo\JniTest\bin\res
D:\Java_2\workspace_indigo\JniTest\bin\classes\com
D:\Java_2\workspace_indigo\JniTest\bin\classes\jni
D:\Java_2\workspace_indigo\JniTest\bin\classes\com\testjni
D:\Java_2\workspace_indigo\JniTest\bin\classes\com\testjni\JniTestActivity.class
D:\Java_2\workspace_indigo\JniTest\bin\classes\com\testjni\R$attr.class
D:\Java_2\workspace_indigo\JniTest\bin\classes\com\testjni\R$drawable.class
D:\Java_2\workspace_indigo\JniTest\bin\classes\com\testjni\R$layout.class
D:\Java_2\workspace_indigo\JniTest\bin\classes\com\testjni\R$string.class
D:\Java_2\workspace_indigo\JniTest\bin\classes\com\testjni\R.class
D:\Java_2\workspace_indigo\JniTest\bin\classes\jni\Natives.class
D:\Java_2\workspace_indigo\JniTest\gen\com
D:\Java_2\workspace_indigo\JniTest\gen\com\testjni
D:\Java_2\workspace_indigo\JniTest\gen\com\testjni\R.java
D:\Java_2\workspace_indigo\JniTest\native\Android.mk
D:\Java_2\workspace_indigo\JniTest\native\Application.mk
D:\Java_2\workspace_indigo\JniTest\native\include
D:\Java_2\workspace_indigo\JniTest\native\lib.c
D:\Java_2\workspace_indigo\JniTest\native\main.c
D:\Java_2\workspace_indigo\JniTest\native\Makefile
D:\Java_2\workspace_indigo\JniTest\native\testlib
D:\Java_2\workspace_indigo\JniTest\native\testlib.c
D:\Java_2\workspace_indigo\JniTest\native\include\jni_Natives.h
D:\Java_2\workspace_indigo\JniTest\native\include\jni_Natives.h_orig
D:\Java_2\workspace_indigo\JniTest\res\drawable-hdpi
D:\Java_2\workspace_indigo\JniTest\res\drawable-ldpi
D:\Java_2\workspace_indigo\JniTest\res\drawable-mdpi
D:\Java_2\workspace_indigo\JniTest\res\layout
D:\Java_2\workspace_indigo\JniTest\res\values
D:\Java_2\workspace_indigo\JniTest\res\drawable-hdpi\ic_launcher.png
D:\Java_2\workspace_indigo\JniTest\res\drawable-ldpi\ic_launcher.png
D:\Java_2\workspace_indigo\JniTest\res\drawable-mdpi\ic_launcher.png
D:\Java_2\workspace_indigo\JniTest\res\layout\main.xml
D:\Java_2\workspace_indigo\JniTest\res\values\strings.xml
D:\Java_2\workspace_indigo\JniTest\src\com
D:\Java_2\workspace_indigo\JniTest\src\jni
D:\Java_2\workspace_indigo\JniTest\src\com\testjni
D:\Java_2\workspace_indigo\JniTest\src\com\testjni\JniTestActivity.java
D:\Java_2\workspace_indigo\JniTest\src\jni\Natives.java

这就是我的 ndk NDK_LOG = 1 的输出:

D:\Java_2\workspace_indigo\JniTest>ndk-build NDK_LOG=1
Android NDK: NDK installation path auto-detected: 'D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8'
Android NDK: GNU Make version 3.81 detected
Android NDK: Host OS was auto-detected: windows
Android NDK:  Host operating system detected: windows
Android NDK: Host CPU was auto-detected: x86
Android NDK: HOST_TAG set to windows
Android NDK: Host tools prebuilt directory: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/prebuilt/windows/bin
Android NDK: Host 'echo' tool: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/prebuilt/windows/bin/echo.exe
Android NDK: Host 'awk' tool: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/prebuilt/windows/bin/awk.exe
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: D:/cpp/Android/android-ndk-r8-windows/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: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/platforms/android-14/arch-arm
Android NDK:   ABI mips sysroot is: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/platforms/android-14/arch-mips
Android NDK:   ABI x86 sysroot is: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/platforms/android-14/arch-x86
Android NDK: PLATFORM android-3 supports: arm mips x86
Android NDK:   ABI arm sysroot is: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/platforms/android-3/arch-arm
Android NDK:   ABI mips sysroot is: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/platforms/android-3/arch-mips
Android NDK:   ABI x86 sysroot is: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/platforms/android-3/arch-x86
Android NDK: PLATFORM android-4 supports: arm mips x86
Android NDK:   ABI arm sysroot is: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/platforms/android-4/arch-arm
Android NDK:   ABI mips sysroot is: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/platforms/android-4/arch-mips
Android NDK:   ABI x86 sysroot is: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/platforms/android-4/arch-x86
Android NDK: PLATFORM android-5 supports: arm mips x86
Android NDK:   ABI arm sysroot is: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/platforms/android-5/arch-arm
Android NDK:   ABI mips sysroot is: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/platforms/android-5/arch-mips
Android NDK:   ABI x86 sysroot is: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/platforms/android-5/arch-x86
Android NDK: PLATFORM android-8 supports: arm mips x86
Android NDK:   ABI arm sysroot is: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/platforms/android-8/arch-arm
Android NDK:   ABI mips sysroot is: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/platforms/android-8/arch-mips
Android NDK:   ABI x86 sysroot is: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/platforms/android-8/arch-x86
Android NDK: PLATFORM android-9 supports: arm mips x86
Android NDK:   ABI arm sysroot is: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/platforms/android-9/arch-arm
Android NDK:   ABI mips sysroot is: D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/platforms/android-9/arch-mips
Android NDK:   ABI x86 sysroot is: D:/cpp/Android/android-ndk-r8-windows/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: .
Android NDK: Ouput path: ./obj
Android NDK: Parsing D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/build/core/default-application.mk
Android NDK:   Found APP_PLATFORM=android-8 in ./project.properties
Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: ./jni/Android.mk
D:/cpp/Android/android-ndk-r8-windows/android-ndk-r8/build/core/add-application.mk:133: *** Android NDK: Aborting...    .  Stop.

和我的 Android.mk

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := Hello
LOCAL_CFLAGS    := -Werror
LOCAL_SRC_FILES := lib.c


include $(BUILD_SHARED_LIBRARY)

and my Application.mk
APP_PROJECT_PATH := D:/Java_2/workspace_indigo/JniTest

喜欢它的简单文档,在说过,但仍然不能工作。为什么它不工作的什么我丢失它是什么?

解决方法 1:

很明显,你 Android.mk 文件位于中错误的地方,因为它是当前 location 是:

native/Android.mk

和你 build script 预计要在

src/jni/Android.mk

您必须更改 script 或复制/移动文件。

官方微信
官方QQ群
31647020