How to remove extra native dependencies from Android app

♀尐吖头ヾ 提交于 2019-12-24 09:02:41

问题


I am using arcgis in my app and it bundles native dependencies that are large in size. I don't want to include the x86 dependency if it means reducing the size of the apk. how do I tell gradle to automatically exclude the x86 native library.

I tried removing it manually during the build. but it shows up again after rebuild.


回答1:


how do I tell gradle to automatically exclude the x86 native library

Use splits:

android {
  // other good stuff here

  splits {
    abi {
      enable true
      reset()
      include 'armeabi-v7a'
      universalApk false
    }
  }
}

This tells Android to build only an ARMv7 version of your APK. You would need to adjust the include line to list what APKs you want.

However, you may be better served using splits to just build a separate x86 APK file (have include 'x86', 'armeabi-v7a') and ship both, so you better support x86 but still have smaller files.



来源:https://stackoverflow.com/questions/31122906/how-to-remove-extra-native-dependencies-from-android-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!