tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

Exclude x86 libs from android build? #2849

Closed rufatagayev closed 6 months ago

rufatagayev commented 6 months ago

I want to create a release build for my app and the libtd libs make up majority of the apk size. How can I remove the x86 and x86_64 libs and still make it work? When I try to exclude them from my package the app doesn't start on a real device neither on an emulator. When they're included, the app works fine. The error I get is:

Caused by: java.lang.UnsatisfiedLinkError: No implementation found for int org.drinkless.tdlib.Client.createNativeClient()

I exclude the two files via the build.gradle file like so:

packagingOptions { exclude("lib/x86/libtdjni.so") exclude("lib/x86_64/libtdjni.so") }

levlam commented 6 months ago

Libs for unrelated architecture aren't installed on the target device, so they don't affect installed application size. They affect only app download size, and only if a universal apk is downloaded directly instead of Google Play.