ideacreation / react-native-barcodescanner

A barcode scanner component for react native - not maintained anymore - use react-native-camera
MIT License
537 stars 162 forks source link

Camera not working on physical device #26

Open jrm2k6 opened 8 years ago

jrm2k6 commented 8 years ago

Hi,

I have an issue where the scanner works fine in my Genymotion controller but doesn't show any preview on a physical device. I modified the permissions in my Android manifest file to include permissions for the camera but still no success.

Versions: "react-native": "^0.25.1", "react-native-barcodescanner": "^2.0.0",

Any idea?

jrm2k6 commented 8 years ago

Still looking for any idea. It is not working consistently making it hard to test on real devices.

jrm2k6 commented 8 years ago

It seems to happen when I try to use several instances of the scanner at once.

andreaskeller commented 8 years ago

@jrm2k6 did you find a workaround for this?

jrm2k6 commented 8 years ago

@andreaskeller I did. I just rearrange the different views to just rerender what is around the scanner and not the scanner itself.

Basically I had screen 1 composed of a text and scanner, screen 2 composed of another text and another scanner and so on. Do you have any input of how to easily debug the Java side of things? I have my logs from adb but I would rather be able to breakpoint.

andreaskeller commented 8 years ago

@jrm2k6 I use Android Studio to debug the Java code. Just open the android folder of your app in Android Studio and then you can set a breakpoint in the react-native-barcodescanner node_modules folder.

I'm interested in what you are building? A personal project or for a client or company?

jrm2k6 commented 8 years ago

@andreaskeller We are trying out react-native at my workplace (tele-dermatology startup) and I am using this scanner as part of an inventory system. We do a lot of shipping so I am creating react-native apps to speed up the shipping process.

jrm2k6 commented 8 years ago

@andreaskeller I am not sure I understand exactly how you debug your Java code. I have an issue where I can scan only once, the next times the autofocus works but my handler for onBarCodeRead is not called. I open the android section of my app in Android studio, but if I setup a breakpoint in the java code, it expects me to run the app from android studio right?