Android Ndk打包错误 More than one file was found with OS independent path 'lib/...

More than one file was found with OS independent path 'lib/armeabi-v7a/....so

这个错误是由于打包时候多次包含so文件

在app/build.gradle

android{

....

sourceSets {

main { jniLibs.srcDirs = ['libs']}

//上面这句话表示将libs中的so文件都打包。

}

}

与此同时,在Android.mk文件中,引入了libs中的第三方的so文件;

例如:

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_3_4_2
LOCAL_SRC_FILES := ../libs/${TARGET_ARCH_ABI}/libopencv_java3.so
include $(PREBUILT_SHARED_LIBRARY)

此时,打包时就会出现错误

 More than one file was found with OS independent path 'lib/armeabi-v7a/libopencv_java3.so

使用Cmake方式编译暂时不清楚是否会出现类似错误。

 

你可能感兴趣的:(android开发)