acceptable-planet-23174
10/10/2025, 5:03 AMimplementation (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
Can we somehow reduce the size?We only need voice features not video.tall-airline-16756
10/10/2025, 5:03 AMtall-airline-16756
10/10/2025, 5:04 AMbuild.gradle file:
buildTypes {
release {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
• Avoid Video APIs: Try to steer clear of video-specific methods or classes like SurfaceViewRenderer or setCameraEnabled(true). This way, video components will be automatically excluded during the build.
• Exclude Video Permissions: Make sure your AndroidManifest.xml only includes the RECORD_AUDIO permission.
• Enable Non-Transitive R Classes: Adding android.nonTransitiveRClass=true to your gradle.properties file can help reduce resource overhead.
• Analyze APK Size: It’s a good idea to use Android Studio’s APK Analyzer to double-check that video-related components have been removed.
Following these steps should really help minimize the SDK’s impact on your app size. If you’d like, I’m here to assist you with setting up ProGuard rules or walking you through analyzing your build. Just let me know!
Sources: app/build.gradle.kts | livekit-android-sdk/src/main/java/io/livekit/android/room/track/video/Video... | Android quickstart | LiveKit Docsacceptable-planet-23174
10/10/2025, 5:14 AMtall-airline-16756
10/10/2025, 5:14 AMsetCameraEnabled(true). You can focus on enabling just the microphone like this:
room.localParticipant.setMicrophoneEnabled(true)
• Skipping video rendering: Make sure not to initialize or attach SurfaceViewRenderer or TextureViewRenderer objects.
• Using ProGuard/R8: These tools help strip out any unused video-related classes during your build process. This usually happens automatically if your code doesn’t reference video APIs.
Even though video-related code stays in the SDK binary, it won’t be included in your final APK if it’s not used. If you’d like, I’m here to help you with ProGuard configurations or any other optimizations you might need. Just let me know!
Sources: livekit-android-sdk/src/main/java/io/livekit/android/room/PeerConnectionTra... | Android quickstart | LiveKit Docsacceptable-planet-23174
10/10/2025, 5:16 AMsetCameraEnabled(true). You can focus on enabling just the microphone like this:
room.localParticipant.setMicrophoneEnabled(true)
Yes i am not using camera.tall-airline-16756
10/10/2025, 5:16 AMSurfaceViewRenderer or VideoTrack.
Following these steps can really help keep your app size nice and small. If you’d like, I’m here to help you check the final APK size or guide you through setting up ProGuard rules—just let me know!acceptable-planet-23174
10/10/2025, 5:17 AMSurfaceViewRenderer or VideoTrack.
Not using ittall-airline-16756
10/10/2025, 5:17 AMacceptable-planet-23174
10/10/2025, 5:30 AMtall-airline-16756
10/10/2025, 5:30 AMlib/ folder is playing a big role in the app size. This folder usually holds native libraries, including the WebRTC components that the LiveKit SDK uses.
Here are a few friendly tips to help shrink the size even more:
• Make sure ProGuard/R8 is actively removing any unused native libraries. For instance, if you’re not using certain video codecs, they should be stripped out automatically.
• Try using the APK Analyzer to take a closer look inside the lib/ folder and see which libraries are taking up the most space.
• Double-check your ProGuard rules to ensure they’re set up to optimize native library shrinking. If you’d like, I’m happy to help you fine-tune these rules.
Feel free to reach out if you want a hand with analyzing the APK or tweaking the configuration further—I’m here to help!acceptable-planet-23174
10/10/2025, 5:33 AMtall-airline-16756
10/10/2025, 5:34 AMlibjingle_peerconnection_so.so is the biggest contributor to the size in the lib/arm64-v8a directory, taking up 11.2 MB. This file comes from the WebRTC library used by the LiveKit SDK and handles both audio and video processing.
To help reduce its size, here are a few friendly suggestions:
• Make sure ProGuard/R8 is enabled to strip out any unused native code. This often helps remove video-related parts if your app doesn’t actually use them.
• Think about using APK splits to exclude ABIs that your app doesn’t need (for example, if you only target arm64-v8a, you can leave out others).
• It might be helpful to analyze the APK further to see if video-related components inside libjingle_peerconnection_so.so are being removed. If they aren’t, we can explore adding some extra ProGuard rules.
Please feel free to reach out if you’d like a hand setting up ABI splits or optimizing ProGuard rules for your native libraries—I’m here to help!