我正在使用
开发Android应用opencv library version 330。
编译项目的当前大小约为100 MB! 真的太大了。 使用proguard作为app模块,APK大小减少了大约3或4 MB。 在opencv库上使用Proguard我收到一个错误。我找不到解决方案但我已经使用了proguard很长时间......
我通过在app/sr/main
下创建jniLibs文件夹来导入库。
现在这个文件夹还包含7个文件夹!
上面列出的每个文件夹都包含相应的.so文件......
我注意到删除了一些像apk这样大小的文件夹大大减少了。 我不是建筑专家,但我可以删除armeabi文件夹,因为(根据我的理解),没有必要支持这种架构。
由于我的应用程序已准备好发布,对于Android设备,我是否知道是否有人可以告诉我支持哪些架构?????
谢谢你们,伙计们:D
答案 0 :(得分:0)
您需要为每个架构构建多个apk,然后将其拆分,然后您可以将其逐个上传到Play商店。了解更多信息 Build Multiple APKs
您可以在app build.gradle中添加split
块来执行此操作:
android {
...
splits {
// Configures multiple APKs based on ABI.
abi {
// Enables building multiple APKs per ABI.
enable true
// By default all ABIs are included, so use reset() and include to specify that we only
// want APKs for x86, armeabi-v7a, and mips.
// Resets the list of ABIs that Gradle should create APKs for to none.
reset()
// Specifies a list of ABIs that Gradle should create APKs for.
include "x86", "armeabi-v7a", "mips"
// Specifies that we do not want to also generate a universal APK that includes all ABIs.
universalApk false
}
}
}