How to reduce your app size?
There are three main contributors to the app size from Face AR SDK:
- Features
- Effect assets
- Debug symbols
Here's how you can mitigate each of them:
Addressing unneeded features:
Install only the features that you need with our Github Packages solution for Android and our Cocoapods solution for iOS. This will let you optimize the download size for your users.
Addressing effect size:
A single 3D face mask could take about 2.5-3MB. Bundling many of them with your app will cause a massive bloat, so we recommend using our AR Cloud. This feature lets you store effects on a remote server while users can download them on demand.
We store our effects in the folder called “effects” and load them to BanubaSdk during the initialize method - BanubaSdkManager.initialize.
In order to load effects from a remote server, you can archive your current effect in a .zip file and send them to the user's device. After that, it should be extracted and added to the ‘effects’ folder.
You can find code examples using AR Cloud here:
https://github.com/Banuba/arcloud-android-kotlin
https://github.com/Banuba/arcloud-ios-swift
Addressing debug symbols:
Ensure that you have the latest NDK installed for Android and are building for release on both Android and iOS. This will result in debug symbols being removed from the final package, massively reducing your SDK size.
While we do have the possibility to not include these debug symbols in the build, without them we will not be able to assist you, as your logs will not include any useful information.