How to reduce the apk size of my Android app with openCv library integrated

前端 未结 2 1769
北海茫月
北海茫月 2021-01-01 03:39

I have searched for this a lot, but didn\'t get a solution and hence posting this.

Scenario: I\'m building an Android app which uses opencv library

相关标签:
2条回答
  • 2021-01-01 04:02

    Use proguard to obfuscate, minify, shrink resources. Just make sure to read docs by OpenCV for their proguard rules, Run android lint for unused resources.

    0 讨论(0)
  • 2021-01-01 04:17

    You can enable ABI splitting in the build.gradle file like this:

        android {
        // Some other configuration here...
    
        splits {
            abi {
                enable true
                reset()
                include 'x86', 'armeabi', 'armeabi-v7a', 'mips'
                universalApk false
            }
        }
    }
    

    Refer this link https://realm.io/news/reducing-apk-size-native-libraries/

    0 讨论(0)
提交回复
热议问题