Hi, we are integrating livekit in our app ``` imp...
# ask-ai
a
Hi, we are integrating livekit in our app
Copy code
implementation (libs.livekit.android){
    exclude(group = "com.github.webrtc-sdk", module = "android")
    exclude(group = "androidx.compose.ui", module = "ui")
  }
Our app size been increase by around 11.732 MB. Is there any other way to decrease the size? We can't cater that much increase in size currently our app size is 25 mb only, we can't take an increase of 11.732mb. We don't need the support of video too currently . Version :-
2.20.1
t
Thanks for reaching out, Himanshu. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To better assist you in reducing the app size, could you please share a bit more about your setup? • Are you using any optional modules like
livekit-android-camerax
or
livekit-android-track-processors
that might be excluded? • Are you working with the standard
client-sdk-android
or the Jetpack Compose version (
components-android
)? Once I have this info, I’d be happy to guide you through some helpful strategies, like modular exclusions or code shrinking configurations, to make things easier for you. Sources: Android quickstart | LiveKit Docs | Multi-Platform Agent Deployment | livekit/livekit_composite | DeepWiki | docs/index.html | livekit-android-track-processors/consumer-rules.pro
a
• Are you using any optional modules like
livekit-android-camerax
or
livekit-android-track-processors
that might be excluded? How to exclude it?
t
I'm happy to help you with excluding optional modules like
livekit-android-camerax
or
livekit-android-track-processors
! You can simply leave out their dependencies from your
build.gradle
file. These modules aren’t included by default, so you only need to add them if you want to use specific features. Here’s a friendly example of how you might set up your `build.gradle`:
Copy code
dependencies {
  def livekit_version = "2.20.2"

  // Required: Core LiveKit SDK
  implementation "io.livekit:livekit-android:$livekit_version"

  // Optional: Exclude CameraX module
  // implementation "io.livekit:livekit-android-camerax:$livekit_version"

  // Optional: Exclude track processors (e.g., virtual background)
  // implementation "io.livekit:livekit-android-track-processors:$livekit_version"
}
By simply commenting out or removing the
implementation
lines for these optional modules, they won’t be part of your app’s build. This is a great way to keep your APK size smaller and avoid unnecessary dependencies. And don’t worry—if you’re not using features like pinch-to-zoom, torch control, or virtual backgrounds, leaving these modules out won’t affect the core camera or microphone functionality that the SDK provides. Sources: livekit-android-track-processors/consumer-rules.pro
a
// Required: Core LiveKit SDK implementation "io.livekitlivekit android$livekit_version" I am doing this only.
t
Thanks for sharing that you’re using the core LiveKit SDK! To better assist you, could you please share a bit more? • Are there any particular features you’re using, like video or advanced audio processing? • Would you find it helpful if I guided you through applying ProGuard/R8 rules to help shrink the SDK size even more? With these details, I’ll be able to offer some tailored suggestions to help reduce your app size. Looking forward to helping you with this! Sources: Android quickstart | LiveKit Docs | Multi-Platform Agent Deployment | livekit/livekit_composite | DeepWiki | livekit-android-track-processors/consumer-rules.pro
a
I am not using video, can we remove it somehow? Yes I am applying proguard
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!
a
Are there any particular features you’re using, like video or advanced audio processing -> I am not using video
Is there any update on this?