# Android Zoom SDK build folder is 300-450 mb

**URL:** <https://devforum.zoom.us/t/android-zoom-sdk-build-folder-is-300-450-mb/27640>\
**Category:** Android\
**Created:** [August 19, 2020, 6:56pm UTC](https://devforum.zoom.us/t/android-zoom-sdk-build-folder-is-300-450-mb/27640 "2020-08-19T18:56:00Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![caleb.c](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@caleb.c](https://devforum.zoom.us/u/caleb.c)\
**Post date:** [August 19, 2020, 6:56pm UTC](https://devforum.zoom.us/t/android-zoom-sdk-build-folder-is-300-450-mb/27640/1 "2020-08-19T18:56:00Z")

</div>

**Description**  
I’ve read several posts here complaining of the SDKs absolutely massive size, however even in those reports the size of the APK “only” doubled or tripled.

Our release APK has gone from 50mb to over 250mb (with ProGuard enabled) after adding Zoom. This is utterly absurd. I’ve cleaned out the project and manually deleted the build folder in the `mobilertc` module (it doesn’t appear to get deleted during a normal Gradle clean task).

Upon rebuilding the project, the `mobilertc` folder is usually somewhere between ~320mb and ~430mb. It is not clear to me why it seems to vary in size. Navigating to the `mobilertc/build` directory shows the directory to be empty, but `ls -a` shows a hidden `.transforms` directory. This directory contains several unknown file types and multiple `.bin` binaries.

**Questions:**

1. What is the `mobilertc/build/.transforms` directory?
2. Why is the `mobilertc/build/.transforms` directory so large?
3. How can we reduce the size of our APK to ensure our release APK does not exceed the size limit enforced by the Play Store?

**Which version?**  
SDK version v5.0.24433.0616

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [August 19, 2020, 10:00pm UTC](https://devforum.zoom.us/t/android-zoom-sdk-build-folder-is-300-450-mb/27640/2 "2020-08-19T22:00:26Z")

</div>

Hi @caleb.c, thanks for the detailed post.

This is highly unusual and I completely understand how this could be concerning and frustrating. Hopefully we can get to the bottom of this ASAP!

We are aware that the size of our SDK is less than ideal (and would like to improve that), but it certainly shouldn’t be causing your APK size to go up _that_ drastically. While we’re looking into this and trying to see if it’s reproducible, some additional info that could help speed up the process:

- When you are cleaning/building the project, is that through CLI (i.e. `./gradlew clean`) or through Android Studio’s build menu?
- A snippet from your `build.gradle` where the SDK modules are added
- A screenshot of your expanded `mobilertc` and `commonlib` modules in Android Studio (no need to expand the build directory for either one)
- Is this a recent issue or has it been a problem since you first imported the SDK?
- (If your app has multiple modules, excluding the SDK) Is the SDK being used in more than one module?

Thanks!

---

<div class="post-metadata">

**Author:** ![caleb.c](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@caleb.c](https://devforum.zoom.us/u/caleb.c)\
**Post date:** [August 19, 2020, 10:15pm UTC](https://devforum.zoom.us/t/android-zoom-sdk-build-folder-is-300-450-mb/27640/3 "2020-08-19T22:15:20Z")

</div>

@jon.zoom

> When you are cleaning/building the project, is that through CLI (i.e. `./gradlew clean` ) or through Android Studio’s build menu?

The clean tasks and build tasks referenced in my original post were all performed via Android Studio’s build menu.

> A snippet from your `build.gradle` where the SDK modules are added

Both modules are simply added via:

```
implementation project(':commonlib')
implementation project(':mobilertc')

```

> A screenshot of your expanded `mobilertc` and `commonlib` modules in Android Studio (no need to expand the build directory for either one)

 ![Screen Shot 2020-08-19 at 3.07.31 PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/2/20c5587a5120251b6af4ce0b0b2e10dc07e8686c.png)

> Is this a recent issue or has it been a problem since you first imported the SDK?

This is the first release build we’ve built since implementing the SDK. We knew that the debug APKs had also drastically increased in size, but assumed that that was due to unused assets and files that would be stripped for a release build.

> (If your app has multiple modules, excluding the SDK) Is the SDK being used in more than one module?

No, we have a single `app` module. The Zoom SDK introduced two modules, `commonlib` and `mobilertc`, bringing the total number of modules in the project to three.

Thanks for the prompt response!

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [August 20, 2020, 5:32pm UTC](https://devforum.zoom.us/t/android-zoom-sdk-build-folder-is-300-450-mb/27640/4 "2020-08-20T17:32:23Z")

</div>

@caleb.c thank you again for the detailed response.

Nothing in particular stands out that could be causing this, so let’s try some troubleshooting steps to see if we can resolve anything stemming from Gradle or Android Studio bugs.

- Invalidate caches and restart - File -\> Invalidate Caches/Restart -\> Invalidate and Restart (in the dialog popup)
- Completely remove the mobilertc and commonlib dependencies from your project and build.gradle, re-download the SDK, and then clean project & invalidate/restart again before adding the SDK back in
- Update Gradle, Android Gradle Plugin, and build tools to the latest supported/stable versions ([Android Gradle release notes](https://developer.android.com/studio/releases/gradle-plugin), [build tools](https://developer.android.com/studio/releases/build-tools))

If all of the above steps aren’t successful, the next step will have to be verifying that this is definitely being caused by the SDK. This could be a bit more involved of a process depending on your implementation. Basically, you would have to remove the SDK from your project again and comment out or delete all references to the SDK before generating your APK. If the size goes back down to the ~50MB size you previously noted, we can pretty confidently say that this is a bug with the Zoom SDK and investigate a fix on our end.

Thanks again, I look forward to hearing from you!

---

<div class="post-metadata">

**Author:** ![caleb.c](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@caleb.c](https://devforum.zoom.us/u/caleb.c)\
**Post date:** [August 20, 2020, 9:09pm UTC](https://devforum.zoom.us/t/android-zoom-sdk-build-folder-is-300-450-mb/27640/5 "2020-08-20T21:09:58Z")

</div>

@jon.zoom

> Invalidate caches and restart - File → Invalidate Caches/Restart → Invalidate and Restart (in the dialog popup)

Invalidated and restarted twice, then built a fresh release APK. The result:  
 ![Screen Shot 2020-08-20 at 10.52.01 AM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/1/1a5ca70dac109cb7cd8f1aa85bdd591ad7d0f43a.png)

> Completely remove the mobilertc and commonlib dependencies from your project and build.gradle, re-download the SDK, and then clean project & invalidate/restart again before adding the SDK back in

I checked out an old commit from _before_ Zoom integration, and removed the `mobilertc` and `commonlib` modules. A release APK built from this revision was the expected size, at roughly ~50mb. I then downloaded a fresh SDK from [here](https://marketplace.zoom.us/docs/sdk/native-sdks/android/getting-started/install-sdk). Afterwards, I added the modules from the fresh download to the project, as specified [here](https://marketplace.zoom.us/docs/sdk/native-sdks/android/getting-started/integration). I then built another release APK on the same revision as before. As noted, this revision had no application code that utilized the SDK. Regardless, the APK was back to ~250mb, as shown below:

![Screen Shot 2020-08-20 at 11.32.53 AM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/8/872e68abcaa22ac5fdec9b09829057160e6e06da.png)  
v5.0.24437.0708

> Update Gradle, Android Gradle Plugin, and build tools to the latest supported/stable versions ([Android Gradle release notes](https://developer.android.com/studio/releases/gradle-plugin), [build tools](https://developer.android.com/studio/releases/build-tools))

I’ve updated Gradle, the Gradle Plugin, _and_ Android Studio to the latest versions. These updates do not appear to have solved the issue.

> If all of the above steps aren’t successful, the next step will have to be verifying that this is definitely being caused by the SDK. This could be a bit more involved of a process depending on your implementation. Basically, you would have to remove the SDK from your project again and comment out or delete all references to the SDK before generating your APK. If the size goes back down to the ~50MB size you previously noted, we can pretty confidently say that this is a bug with the Zoom SDK and investigate a fix on our end

Please see the comments above. Checking out the commit directly before the commit which integrated the Zoom SDK results in an APK around ~50mb, as expected.

Note that the increased size appears to be primarily caused by by the `/lib` directory, as shown below:

 ![Screen Shot 2020-08-20 at 2.06.33 PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/5/5e5ba90f89f1707b0d097c0e789da95ea0a3e4e5.png)

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [August 20, 2020, 11:57pm UTC](https://devforum.zoom.us/t/android-zoom-sdk-build-folder-is-300-450-mb/27640/6 "2020-08-20T23:57:21Z")

</div>

@caleb.c thank you for bearing with us through this process and providing extremely detailed responses, it’s greatly appreciated. 🙂

Looking at the APK analyzer at least gives us a (temporary) solution for getting your APK size under the play store limit while we figure out the root cause. For that, we recommend [creating one APK per ABI](https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split). Based on your APK breakdown, this would reduce the increase in size to between 25MB - 50MB, depending on ABI.

After setting up a project locally and integrating the SDK, I am seeing a total size of 21.6MB for the libs directory (only using one ABI though), so there’s definitely something else going on here. If you take the same steps of deleting and re-integrating the SDK into our [sample app](https://github.com/zoom/zoom-sdk-android/tree/master/mobilertc-android-studio/example2), are you still seeing a similar increase in APK size? This step will help greatly narrow down our potential causes.

Let me know if you have any questions. Thanks!

---

<div class="post-metadata">

**Author:** ![caleb.c](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@caleb.c](https://devforum.zoom.us/u/caleb.c)\
**Post date:** [August 21, 2020, 2:04am UTC](https://devforum.zoom.us/t/android-zoom-sdk-build-folder-is-300-450-mb/27640/7 "2020-08-21T02:04:24Z")

</div>

@jon.zoom

> For that, we recommend [creating one APK per ABI](https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split). Based on your APK breakdown, this would reduce the increase in size to between 25MB - 50MB, depending on ABI.

APK splitting is not feasible for us. We’ve considered switching to App Bundles for distribution if a fix for this issue is not released, but even then we’d already be close to the 150mb limit defined by the Play Store.

I believe I have found a way to reliably reproduce the issue, even using the sample application provided by Zoom. The steps needed to reproduce the issue are as follows:

1. Clone the [repository](https://github.com/zoom/zoom-sdk-android).
2. Update the project to the latest Gradle and Android Gradle Plugin versions (6.1.1 and 4.0.1, respectively).
3. Zoom has migrated to AndroidX ([GitHub - zoom/zoom-sdk-android: Zoom Android SDK](https://github.com/zoom/zoom-sdk-android#latest-sdk-news)), but did not set the [requisite](https://developer.android.com/jetpack/androidx#using_androidx_libraries_in_your_project) `android.useAndroidX` flag to `true`. As such, Gradle syncs will fail after updating the Gradle and Android Gradle Plugin versions. Create a `gradle.properties` file in the project root with an `android.useAndroidX` property set to `true`.
4. Set the `minSdkVersion` to 23 (Marshmallow). Optionally, remove the explicit `buildToolsVersion` found in the sample app to [ensure that the project uses the default version provided by the plugin](https://developer.android.com/studio/releases/build-tools).
5. Create a signed release build, and observe the APK size.

The result:

![Screen Shot 2020-08-20 at 7.02.43 PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/0/04752fde7e9604e7c0b5033cdabbe73958f86956.png)

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [August 21, 2020, 6:06pm UTC](https://devforum.zoom.us/t/android-zoom-sdk-build-folder-is-300-450-mb/27640/8 "2020-08-21T18:06:52Z")

</div>

@caleb.c, thanks for testing it out with the demo app.

After following your steps and generating a release APK, I am seeing a significantly smaller size. ![Screen Shot 2020-08-21 at 11.44.09 AM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/7/799ed3d54d827570ce1bf7991317ad18f70b5d5f.png)

Since you’re able to reproduce this in the demo app, you obviously are not doing anything wrong with how you are integrating the SDK. The only possible difference that could be causing this would be our environments. If you’d like to confirm that, you could create an empty “Hello world” project in Android Studio and integrate the SDK before generating a release APK. If you’re still seeing something around 200MB after doing this, there must be something in your environment causing APK sizes to be greatly inflated.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![caleb.c](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@caleb.c](https://devforum.zoom.us/u/caleb.c)\
**Post date:** [August 24, 2020, 4:45pm UTC](https://devforum.zoom.us/t/android-zoom-sdk-build-folder-is-300-450-mb/27640/9 "2020-08-24T16:45:35Z")

</div>

@jon.zoom

Are you _absolutely positive_ you followed my instructions precisely? This issue has also been reproduced by a colleague of mine on his own machine, so I highly doubt the issue is with our environments. We are both using macOS.

Do you have anything set in your system level Gradle properties file?

I will attempt to reproduce the issue again using a blank project.

---

<div class="post-metadata">

**Author:** ![caleb.c](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@caleb.c](https://devforum.zoom.us/u/caleb.c)\
**Post date:** [August 24, 2020, 6:10pm UTC](https://devforum.zoom.us/t/android-zoom-sdk-build-folder-is-300-450-mb/27640/10 "2020-08-24T18:10:01Z")

</div>

@jon.zoom

I was able to reproduce the issue again on a newly created Android project.

![Screen Shot 2020-08-24 at 11.05.33 AM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/8/8296306be73974d9d10a9cd123dcaf065b154b50.png)

Given the large number of similar posts on this forum, the ability to reproduce the issue on both Zoom’s own sample applications and a newly created project, and the fact that another individual on another machine was able to reproduce the issue independently, it seems logical to assert that the problem is with the Zoom SDK.

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [August 24, 2020, 10:59pm UTC](https://devforum.zoom.us/t/android-zoom-sdk-build-folder-is-300-450-mb/27640/11 "2020-08-24T22:59:14Z")

</div>

@caleb.c, we were able to reproduce and have a solution! In your manifest, add the following attribute to your `application` element: `android:extractNativeLibs="true"`.

All versions of AGP \>= 3.6.0 set this to false by default and so it must be manually overridden. It is also only used in API levels 23+, which would explain why some other developers haven’t been seeing as drastic of a size increase (we support a minSdkVersion of 21+). Let me know if there are any issues with using this on your end.

Thanks!

---

<div class="post-metadata">

**Author:** ![caleb.c](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@caleb.c](https://devforum.zoom.us/u/caleb.c)\
**Post date:** [August 24, 2020, 11:46pm UTC](https://devforum.zoom.us/t/android-zoom-sdk-build-folder-is-300-450-mb/27640/12 "2020-08-24T23:46:56Z")

</div>

@jon.zoom

Setting `android:extractNativeLibs="true"` appears to reduce the APK size from about ~250mb to ~120mb. This is an improvement, but it’s still over the limit imposed by the Play Store. The `lib/` directory alone takes up nearly ~90mb, leaving those who wish to implement the SDK only ~10mb for the rest of their application. Additionally, it’s my understanding that setting this flag to `true` results in a decrease in runtime performance (and increase in size on disk) as uncompressed native files will not be loaded directly from the APK.

Are there any other solutions? Again, leaving only ~10mb for the rest of the application is not feasible for most.

As an aside, do you have any idea what the `libzChatApp.so` file is? It is nearly 11mb for `arm64-v8a` alone.

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [August 25, 2020, 4:46pm UTC](https://devforum.zoom.us/t/android-zoom-sdk-build-folder-is-300-450-mb/27640/13 "2020-08-25T16:46:42Z")

</div>

@caleb.c, unfortunately the only other option I am aware of that could help get your APK size under 100MB is through one APK per ABI, which you’ve already mentioned is not an option for you. We hope to improve this in the future, but do not have a better option than that in the immediate term.

Thanks!

---

<div class="post-metadata">

**Author:** ![caleb.c](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@caleb.c](https://devforum.zoom.us/u/caleb.c)\
**Post date:** [August 31, 2020, 5:39pm UTC](https://devforum.zoom.us/t/android-zoom-sdk-build-folder-is-300-450-mb/27640/14 "2020-08-31T17:39:55Z")

</div>

@jon.zoom

We ended up moving to App Bundles. Even so, the App Bundle (~130mb) is already relatively close to the Play Store limit for App Bundles (150mb). We eagerly await any future updates that may reduce the size of the SDK.

I appreciate your help throughout this thread!

---

<div class="post-metadata">

**Author:** ![danhloc](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/danhloc/32/31444_2.png) [@danhloc](https://devforum.zoom.us/u/danhloc)\
**Post date:** [October 3, 2021, 3:18pm UTC](https://devforum.zoom.us/t/android-zoom-sdk-build-folder-is-300-450-mb/27640/15 "2021-10-03T15:18:56Z")

</div>

Have you got the best solution yet? add android:extractNativeLibs="true it reduces the performance of the app a lot

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [October 4, 2021, 7:57pm UTC](https://devforum.zoom.us/t/android-zoom-sdk-build-folder-is-300-450-mb/27640/16 "2021-10-04T19:57:34Z")

</div>

Hi @danhloc, thanks for using the dev forum.

In addition to the `extractNativeLibs` attribute, another approach to help reduce APK size [mentioned earlier](https://devforum.zoom.us/t/android-zoom-sdk-build-folder-is-300-450-mb/27640/6) in this thread is to use `abiFilters` in your `build.gradle` file. 🙂

Thanks!
