0

I integrating Zoom Sdk to my application. Zoom Sdk adds ~80Mb to the release apk after build. But I have a lot of flavors of my app and only one or two of them actually use zoom. All other apps are releasing without using zoom feature.

I want to exclude all zoom-code from my final apk in some flavors to save small size of apk. How to do it? It will be good if you suggest me solution that excludes zoom module during apk assembling.

UPDATE:

Zoom includes not in app directly, it includes transitevly via other core module: app<--core<--zoom

I can't read flavor of app inside of core module. I expect there is a solution which can implement core dependency with kind of parameter which includes or excludes zoom module during building an apk. Kinda:

implementation project(":core", withZoom = true)

or

def coreModule = project(":core")
coreModule.setParam("zoom", true)
implementation coreModule
P. Ilyin
  • 761
  • 10
  • 28
  • Does this answer your question? [Restrict dynamic feature module to certain BuiltTypes](https://stackoverflow.com/questions/58996786/restrict-dynamic-feature-module-to-certain-builttypes) – tir38 Sep 28 '21 at 21:24

1 Answers1

0

You can define dependencies for specific flavors. Check out this SO-post here: How to define different dependencies for different product flavors

So you could add the zoom dependency only for the two flavors which need them.

Another method is using android dynamic feature module delivery with on-demand delivery. This allows you to download a module only if your app requests it. Since the size of your zoom module would be bigger than 10 MB, the user would see a system dialog which asks if the feature can be downloaded. This is not great for the user experience but it is a way to reduze the app size for the other flavors.

Check out how to use dynamic feature modules here: https://developer.android.com/guide/app-bundle/dynamic-delivery

Alexander Hoffmann
  • 5,104
  • 3
  • 17
  • 23
  • Zoom SDK is not support Dynamic Module Delivery. Checkout this link https://devforum.zoom.us/t/zoom-android-sdk-integration-in-android-dynamic-feature-module/7611/7 – Bhavesh Jabuvani Aug 05 '20 at 09:49
  • @BhaveshJabuvani This could be correct. However, the described resource problem in the thread can be resolved by following the suggestions from this thread. https://stackoverflow.com/questions/54807720/error-using-styles-in-dynamic-modules-android-app-bundle – Alexander Hoffmann Aug 05 '20 at 11:49