Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to reduce the apk size of Android app which need openCv lib( only for Image processing)

I have tried through several answers like apk split , Flavors Build but it does not works for me.

I'm building an Android app with min sdk 15, which uses opencv library.The problem is when I build apk size of it is more then 60 MB which is not very great.

I checked the app file, I could see that the size is too big due to libopencv_java3.so file in all architectures like amr64, armeabi, mips, x86 etc.

image description

I am using openCv only for image processing.This library has a lot of other features like video processing, 3d image, object detection and much more, which I don't need in my app like

If I remove all those files and build APK, then size will be reduced 50 mb , but to make this app work I need to install OpenCVManager to run my app.

Is there any way by which I can reduce my apk size?

Or is it possible just to extract only the feature from openCv which I am intersted in and create .so for those features?

click to hide/show revision 2
retagged

updated 2017-07-07 00:14:15 -0600

berak gravatar image

How to reduce the apk size of Android app which need openCv lib( only for Image processing)

I have tried through several answers like apk split , Flavors Build but it does not works for me.

I'm building an Android app with min sdk 15, which uses opencv library.The problem is when I build apk size of it is more then 60 MB which is not very great.

I checked the app file, I could see that the size is too big due to libopencv_java3.so file in all architectures like amr64, armeabi, mips, x86 etc.

image description

I am using openCv only for image processing.This library has a lot of other features like video processing, 3d image, object detection and much more, which I don't need in my app like

If I remove all those files and build APK, then size will be reduced 50 mb , but to make this app work I need to install OpenCVManager to run my app.

Is there any way by which I can reduce my apk size?

Or is it possible just to extract only the feature from openCv which I am intersted in and create .so for those features?