mrousavy / react-native-vision-camera

📸 A powerful, high-performance React Native Camera library.
https://react-native-vision-camera.com
MIT License
7.35k stars 1.07k forks source link

🐛 APK Size increase After implementing react-native-vision-camera lib double the apk size #2893

Open vinod1988 opened 4 months ago

vinod1988 commented 4 months ago

What's happening?

I was using camera kit lib but due to some issue i switched to react-native-vision-camera and my apk size increase double.

Reproduceable Code

<Camera
                style={{ flex: 1 }}
                device={device}
                isActive={true}
                focusable={true}
                torch={torchMode ? "on" : "off"}
                enableZoomGesture={true}
                zoom={zoomLevel}
                codeScanner={codeScanner}
              />

Relevant log output

above code is working fine but when exporting the apk my apk size double the earlier size

Camera Device

<Camera
                style={{ flex: 1 }}
                device={device}
                isActive={true}
                focusable={true}
                torch={torchMode ? "on" : "off"}
                enableZoomGesture={true}
                zoom={zoomLevel}
                codeScanner={codeScanner}
              />

Device

Oppo android version 13

VisionCamera Version

4.0.3

Can you reproduce this issue in the VisionCamera Example app?

I didn't try (⚠️ your issue might get ignored & closed if you don't try this)

Additional information

Farhankhaliid commented 4 months ago

Same APK size increased to double.

mrousavy commented 4 months ago

..at least share some numbers? what am I supposed to do with that issue?

PerovArtemWork commented 4 months ago

@mrousavy Before update - 39.1 MB ,after 76.7 MB. "react-native-vision-camera": "4.0.5". It happens only on android.

mrousavy commented 4 months ago

Did you disable the CodeScanner?

Maybe that's what's increasing the storage.

Can you try to remove the MLKit CodeScanner dependency from VisionCamera's build.gradle, then also removing it from everywhere in the code where it shows errors?

Would like to see the sizes after that.

maintenance-hans[bot] commented 3 months ago

Guten Tag, Hans here.

[!NOTE] New features, bugfixes, updates and other improvements are all handled mostly by @mrousavy in his free time. To support @mrousavy, please consider 💖 sponsoring him on GitHub 💖. Sponsored issues will be prioritized.