我的应用程序有一个本机部分,它调用本机 Opencv 的相机库。
我唯一的问题是 NDK-build 不会自动将必要的 libnative_camera* * .so 复制到libs
文件夹中。
每次我对 JNI 的代码进行更改(恰好每分钟大约 3 次)时,我都必须手动复制它们,这很好但很烦人。
这只发生在 native_camera 库中,opencv_java
会自动复制。
这是我的 Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
OPENCV_INSTALL_MODULES:=on
OPENCV_CAMERA_MODULES:=on
OPENCV_LIB_TYPE:=SHARED
OPENCV_PATH := /home/tran/signs/OpenCV-2.4.5-android-sdk/sdk/native
include $(OPENCV_PATH)/jni/OpenCV.mk
LOCAL_SRC_FILES := cameramodule.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH)
LOCAL_LDLIBS += -lGLESv1_CM -ldl -llog
LOCAL_MODULE := cameramodule
include $(BUILD_SHARED_LIBRARY)
如何更改它以告诉 NDK-build 为我进行复制和粘贴?
更新:
我使用 Eclipse 编译我的应用程序。这是项目的结构:
PROJECT
|
|
|---src
|---gen
|---res
|---jni
|---libs
|---lib (Someone suggest this folder but I can see it has no use)
|... files and temporary folders
** 更新 **
ndk-build
日志:
rm -f project/libs/armeabi/lib*.so project/libs/armeabi-v7a/lib*.so project/libs/mips/lib*.so project/libs/x86/lib*.so
rm -f project/libs/armeabi/gdbserver project/libs/armeabi-v7a/gdbserver project/libs/mips/gdbserver project/libs/x86/gdbserver
rm -f project/libs/armeabi/gdb.setup project/libs/armeabi-v7a/gdb.setup project/libs/mips/gdb.setup project/libs/x86/gdb.setup
Install : libcameramoduleged.so => libs/armeabi-v7a/libcameramodule.so
install -p project/obj/local/armeabi-v7a/libcameramodule.so project/libs/armeabi-v7a/libcameramodule.so
ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-strip --strip-unneeded project/libs/armeabi-v7a/libcameramodule.so
Install : libopencv_java.so => libs/armeabi-v7a/libopencv_java.so
install -p project/obj/local/armeabi-v7a/libopencv_java.so project/libs/armeabi-v7a/libopencv_java.so
ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-strip --strip-unneeded project/libs/armeabi-v7a/libopencv_java.so