-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App crashes in release mode🐛 #954
Comments
Hey, can you share your function |
I've followed this steps: https://www.dynamsoft.com/codepool/react-native-qr-code-scanner-vision-camera.html |
did you add the native plugin as mentioned in that article? it looks to me like the native plugin is not correctly registered. Also, please share the initial logs that are logged by VisionCamera to Logcat on app-start, it says "Registering Plugins" or something like that. maybe @xulihang has an idea? |
This seems to be related to proguard. Have you enabled proguard? Try to add the following rules:
|
I've just tried adding those rules as I have enableProguardInReleaseBuilds enabled, so that would make sense, but it's not working. This is the code: MainApplication.java:
ProductScanRNCamera.js (my react-native component):
What I got from logcat of app filtering by VisionCamera :
|
Try to disable proguard first. If the error still exists, it is not related to proguard. |
In my case, when I run the example with proguard disabled, it works fine. But when I enabled proguard, there is a worklet error even after I have added proguard rules. |
Seem to be related with proguard, but I need it if I wanna shared this app. |
Vision camera may also need adding rules. I find a commit about this: https://github.com/mrousavy/react-native-vision-camera/pull/465/files |
I've just found that one as well, it's building, let see if that works. . |
Na, I'm trying this rules:
But nothing seems to be solving the problem. |
I've managed to solve this by adding the rules mentioned in this Xamarin project: https://github.com/JimmyPun610/BarcodeScanner.XF The following rule is also needed:
|
Same error with crash. |
What is the error message? My build works fine with the following rules:
|
The error is the same as the last one, like this one:
|
Then I have no idea what the reason is. Maybe you can examine your project with my example: https://github.com/xulihang/vision-camera-dynamsoft-barcode-reader/tree/main/example |
It seem that when minifying the project, the apk doesn't recognize the decode function, the one included here: |
Minifying? Are you using a custom minifyer? That might be the reason because it renames functions like |
By minify I mean this
|
Is there a solution to the problem? |
Hey! I've rewritten the entire Android codebase of VisionCamera from CameraX to Camera2 in the efforts of ✨ VisionCamera V3. I just now completed the Camera2 rewrite and I believe the core structure is running, but there might be some edge cases to iron out. Can you try and test the PR #1674 for me to see if you can still reproduce this issue here? Here's an instruction on how you can test that: #1674 (comment) If the issue cannot be reproduced with that version/PR anymore, then hoorayy, I fixed it! 🎉 Thank you! |
If I used enableProguardInReleaseBuilds=true then app crashes when i open camera from react-native-vision-camera. |
Does it work if you disable proguard? |
What were you trying to do?
I'm trying to assemble the release apk.
Reproduceable Code
What happened instead?
When it's built, and when trying to use the camera, the apk crashes every time. This works perfectly on debug mode.
Relevant log output
Device
Mi Note 10 Pro
VisionCamera Version
2.13.1
Additional information
The text was updated successfully, but these errors were encountered: