I am trying to create a module with the Android NDK, but I can't seem to get the build program to take the path variable. I have tried setting it as an environment variable in cygwin:
$ echo $NDK_MODULE_PATH
/cygdrive/c/dev/code/git/android_source
I also specify it within the Android.mk file:
#===================================
LOCAL_PATH:= $(call my-dir)
NDK_MODULE_PATH := $(LOCAL_PATH)/../../code/git/android_source/
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := user
LOCAL_MODULE := libFilters
LOCAL_SRC_FILES := SkewFilter.cpp SkewFilter.h
LOCAL_LDLIBS := -llog
LOCAL_EXPORT_LDLIBS := -lz
LOCAL_SHARED_LIBS := libskia
include $(BUILD_SHARED_LIBRARY)
#===================================
$(call import-module,libskia)
The end result is still this:
$ ndk-build
Android NDK: jni/Android.mk: Cannot find module with tag 'libskia' 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:
jni/Android.mk:17: *** Android NDK: Aborting. . Stop.
Anyone have any idea of what I'm doing wrong?
I found this question How to specify directory for NDK_MODULE_PATH but it wasn't any help.
I figured out what I was doing wrong. This line in the Android.mk file needs to change from:
$(call import-module,libskia)
to
$(call import-module,external/skia)
It doesn't do a recursive search for the module so when calling import-module it needs the full path relative to your NDK_MODULE_PATH (NDK_MODULE_PATH + path_to_module).
The error message that ndk-build prints seems to be wrong since it doesn't list any paths in the NDK_MODULE_PATH variable, but they are there and it uses them.
Hope this helps someone else.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.