Android Studio/Gradle不会打包我的名为"mylib.so.1"的共享库.在APK中

问题描述:

我需要将一个名为"mylib.so.1"的共享库打包到APK中,但显然gradle无法识别".so.1"扩展名,只有".so",并且在运行时我需要一个名为".library". so.1,以避免链接器错误.所有库都在src/main/jniLibs/$ {ANDROID_ABI}中.

I need to pack a shared library named "mylib.so.1" into APK,but apparently gradle does not recognize ".so.1" extension, only ".so" and at runtime I need the library named ".so.1" to avoid linker errors. All libs are in src/main/jniLibs/${ANDROID_ABI}.

您需要将后缀精确地设置为 .so .因此,删除多余的 .1

You need to make the suffix be exactly .so. So remove the redundant .1