I'm trying to reduce the APK of an android app. I found that there is a native library (libmupdf_java.so) used causes the APK to become larger than the expected size (It added 20MB extra size to the APK please check the attached image). The project has a lot of dependencies (and libraries) I couldn't find which library uses libmupdf_java.so.
Solutions I tried
In .gradle(app) file
exclude 'lib/armeabi-v7a/libmupdf_java.so' exclude 'lib/arm64-v8a/libmupdf.so' exclude 'lib/armeabi/libmupdf.so' }
The app builds successfully but I didn't know if it will fail during the runtime and crash or if it's successfully built means that all things are correct and no need to worry about any failure.
- In .gradle(app) file in release section of build types
ndk {
abiFilters 'arm64-v8a'
}
The app builds successfully but I target only the ARMv8-A based CPUs
instead of targeting all three architectures (armeabi-v7a
, arm64-v8a
, armeabi
)
I don't know what's the best or preferred solution.
Gradle dependencies most of them are jar files. One of them may be using the libmupdf.so : Jar files names:
- DO_AndroidSDK_v2.4.9.jar
- BixolonPrinterV234.jar
- ZSDK_ANDROID_API.jar
- commons-io-2.2.jar
- commons-net-3.0.1.jar
- commons-validator-1.4.0.jar
- httpcore-4.3.jar
- jackson-core-2.2.3.jar
- httpmime-4.3.2.jar
- jackson-annotations-2.2.3.jar
- jackson-databind-2.2.3.jar
- opencsv-2.2.jar
- jackson-core-2.2.3.jar
- snmp6_1.jar
Please, help me if you could.