Adding Klarna SDK to our App increases our APK (downloadable) size by 5MB
tanmayyy opened this issue · comments
Describe the bug
After adding the Klarna In App Android SDK to our app, our App (downloadable) size increased by over 5 MB and overall app size increased by 10 MB (uncompressed).
To Reproduce
Build a release build with Klarna SDK. Analyze the APK using APK Analyzer.
Expected behavior
To not increase our App size so significantly.
Device and version:
- Device: All
- OS version: All
- Klarna In-App SDK version 2.1.5
Merchant Name
Vestiaire Collective
Impact Level
It increased our App size drastically which can have a negative impact on our app propagation.
Additional context
I did some digging on why the apk size increases so drastically. The main contributor is the Tensorflow lite dependency. (org.tensorflow:tensorflow-lite:1.15.0
) It adds a bunch binaries that contribute directly to the increase in apk size. (libtensorflowlite_jni.so
files)
It also adds a resource file which is over 1 MB - FJ.tflite
I tried excluding the dependency but then the In App SDK stopped working.
Hi @tanmayyy, the default(full) variant of the SDK includes these resources for the card scanning feature. Alternatively, if you don't want that feature and prefer a smaller package, you can use implementation 'com.klarna.mobile:sdk-basic:2.1.6'
instead of implementation 'com.klarna.mobile:sdk:2.1.6'
.
I am closing this issue now, but don't hesitate to contact us if you notice this or any other problem.