Skip to content
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

[iOS] React Native 0.75.3 Crash on Opening Camera #29

Closed
ravindraguptacapgemini opened this issue Oct 23, 2024 · 6 comments
Closed

[iOS] React Native 0.75.3 Crash on Opening Camera #29

ravindraguptacapgemini opened this issue Oct 23, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@ravindraguptacapgemini
Copy link

Current behaviour

I have recently upgraded app to 0.75.3, and the App has started crashing on camera open

Expected behaviour

App should work fine without any crash and scan codes

How to reproduce?

Just try to open camera for code scan

Preview

Screenshot 2024-10-24 at 12 04 48 AM

What have you tried so far?

Tried debugging the issue on Xcode, not able to get a clear root cause

Your Environment

software version
ios 15.2
android x
react-native 0.75.3
@pushpendersingh/react-native-scanner 1.2.0
node 18.17.1
yarn 1.22.19
@ravindraguptacapgemini ravindraguptacapgemini added the bug Something isn't working label Oct 23, 2024
@pushpender-singh-ap
Copy link
Owner

Hi @ravindraguptacapgemini, Can you provide a minimal repro which demonstrates the issue?

@pushpender-singh-ap
Copy link
Owner

Hi @ravindraguptacapgemini

Thank you for bringing up the issue. I have tested the @pushpendersingh/react-native-scanner library on both React Native versions 0.75.3 and 0.76.0. After thorough debugging, I can confirm that the library is functioning as expected without any issues in these versions.

If you'd like to test it yourself, please try the example provided in the example folder. The example has been upgraded to React Native 0.76.0 and is working fine. If you need to test the library on version 0.75.3, you can find the relevant example in the example/0.75.3 branch.

Please feel free to reach out if you have any further questions or need additional assistance. For now, I am closing this issue.

Best regards,
Pushpender Singh

@ravindraguptacapgemini
Copy link
Author

@pushpender-singh-ap okay let me check it again, I have few more changes in my local repo.
Can you please let me know, why we need to use Command
Commands.releaseCamera(cameraRef.current);
rather calling the methods directly on the ref
cameraRef.current.releaseCamera();

@pushpender-singh-ap
Copy link
Owner

Hi @ravindraguptacapgemini

It’s essential to use Commands.releaseCamera(cameraRef.current) instead of calling cameraRef.current.releaseCamera() directly because the Commands object utilizes React Native's code generation system for native commands. This approach ensures that the command is dispatched correctly to the native layer, maintaining proper interaction between the JavaScript and native modules.

@ravindraguptacapgemini
Copy link
Author

@pushpender-singh-ap there is a definite crash when opening camera.
I have found it that it's happening due to the API Validation under diagnostics settings in scheme
Screenshot 2024-10-24 at 5 26 49 PM

Currently, after disabling this option prevents crash. So we have a workaround but I am not sure what will be the impacts after disabling this option.

@pushpender-singh-ap
Copy link
Owner

Hi @ravindraguptacapgemini

Thank you for the update. I'm not sure why you're experiencing this issue, as everything works fine on my end. I’ve tested the library in both React Native versions 0.75.3 and 0.76, with the API Validation enabled, and I haven’t encountered any crashes.

Have you had a chance to test the example provided in the example folder? It could help identify if the issue is specific to your project setup.

Please let me know if you need further assistance or guidance in troubleshooting this.

Best regards,
Pushpender Singh

Screenshot 2024-10-24 at 5 44 28 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants