从Android Gradle Plugin 0.7看起来有NDK支持。
但是我在配置它时遇到了麻烦......
错误看起来类似于这个问题:Android NDK: No rule to make target但它有所不同。
因为user2359247表示ndk-build
在意外位置查找BitmapBlur.c
。
执行汇编任务时,我收到错误:
/opt/android-ndk-r8e/ndk-build NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/home/martynas/app/application/build/ndk/flavor/release/Android.mk APP_PLATFORM=android-18 NDK_OUT=/home/martynas/app/application/build/ndk/flavor/release/obj NDK_LIBS_OUT=/home/martynas/app/application/build/ndk/flavor/release/lib APP_ABI=all
Error Code:
2
Output:
make: *** No rule to make target `/home/martynas/app/application/build/ndk/flavor/release//home/martynas/app/application/src/main/jni/BitmapBlur.c', needed by `/home/martynas/app/application/build/ndk/flavor/release/obj/local/armeabi-v7a/objs/application//home/martynas/app/application/src/main/jni/BitmapBlur.o'. Stop.
项目结构:
app
application
src/main/java
src/main/jni
Android.mk
BitmapBlur.c
BitmapBlur.h
我的Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := BitmapBlur
LOCAL_SRC_FILES := BitmapBlur.c
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog
LOCAL_LDLIBS += -ljnigraphics
include $(BUILD_SHARED_LIBRARY)
我的build.gradle没有任何与NDK相关的特定配置。
我做错了什么?所有android-ndk示例都显示了类似的配置。