thegrizzlylabs / geniusscan-sdk-demo

Demo apps for Genius Scan SDK
30 stars 39 forks source link

APK size too big #61

Closed aliza-khu closed 1 year ago

aliza-khu commented 1 year ago

Google API Error: Invalid request - APK size too big.

Uploading App APK to the Google Play Store action failed due to the APK size being too big.

While analyzing the APK in Android Studio and compare with my previous APK I found that the files of library @thegrizzlylabs/react-native-genius-scan like libgssdk-core.so and libgssdk-ocr.so are getting almost increased to 2x or 3x. I found that is the only reason behind APK failing to upload as the rest of the files are getting reduced after Hermes is included.

Below is the current project configuration:

"react": "18.1.0", "react-native": "0.70.5", "@thegrizzlylabs/react-native-genius-scan": "^4.7.3",

Below is the screenshot of the file increased for your reference:

Previous APK react-native@0 66 4

Latest APK react-native@0 70 5

guillaume-tgl commented 1 year ago

What was the version of our SDK used in your "previous APK"? Do you have the logs of the APK generation to make sure minification is applied in the second case?

aliza-khu commented 1 year ago

previous APK, "@thegrizzlylabs/react-native-genius-scan": "4.5.0"

aliza-khu commented 1 year ago

In terms of minification, It was turned off in build.gradle for both cases.

guillaume-tgl commented 1 year ago

In terms of minification, It was turned off in build.gradle for both cases.

Sorry I meant native symbol stripping, not minification

aliza-khu commented 1 year ago

We have automated release pipeline using circle ci and fastlane. In Gradle release job, it have below stripping logs: "Unable to strip the following libraries: libgssdk-core.so, libgssdk-ocr.so" and few others.

When we build application in local machine then the native symbols are stripped successful but don't work with fastlane.

guillaume-tgl commented 1 year ago

Okay, then this means Gradle has trouble finding the right version of the NDK installed on the CI machine. Do you have the NDK installed on the Ci machine? I've tried to find a way to convert this warning into an error to fail a build when stripping fails but I haven't found anything so far.

aliza-khu commented 1 year ago

Yes, I verify and found that NDK was missing in the CI machine. I installed it and found the APK size is reduced. Thank You for your support.