ideacreation / react-native-barcodescanner

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

No image from camera on Android 6.0 #44

Open j-burgos opened 8 years ago

j-burgos commented 8 years ago

I've had this issue trying an application on two devices: a Nexus 5 and a Moto X Pure both with android 6.0.

However I've tested the application on different devices ranging from Android 4.4 to 5.1 and everything seems to be working just fine.

My application uses React Native 0.29

download_20160722_111614 screenshot_20160721-113540

j-burgos commented 8 years ago

I found out that it has to do with Android 6.0 permission model. It would be needed to ask for the camera permission at runtime or set the compile version to 22 to use the older permission model

namxam commented 8 years ago

Are you sure. I have the same issue with an older device with 4.4.2 Sometimes the camera works… sometimes it just stays black.

j-burgos commented 8 years ago

I only had this issue with Android 6 @namxam :/ There, it was always black. It never worked

andreaskeller commented 8 years ago

@j-burgos I saw you changed the targetSdkVersion to 22 in your fork. Did that solve the problem for you?

andreaskeller commented 8 years ago

@namxam which react-native and react-native-barcodescanner version are you using?

j-burgos commented 8 years ago

@andreaskeller it solves it. However, since I already had an app in the Play Store I was not allowed to upload an APK with an older permission model. I used this component to ask for permissions at runtime: https://github.com/lucasferreira/react-native-android-permissions

ThaJay commented 8 years ago

I get the black screen sometimes on a android 4.4.4 phone. and one of my testers on 5.1.1 so it's probably not a permissions issue for us, rather than a initialisation issue.

Any more suggestions on how to tackle this?

swaroopa94 commented 7 years ago

I get the black screen sometimes on a android 5.0.1 in remaining versions its working fine. so please me to solve this.

fabripeco commented 7 years ago

Hi, I have the same issue with RN 0.37 (targetSDKVersion 22). It happens always on Android 6.0, sometimes on 5.0.1. For Android 6.0 it seems that, if I block the screen with the device side button and then unblock it, the camera starts to work. Any ideas? Thank you