Closed wublack closed 10 months ago
Well I guess there's your problem 'The given Camera device (id: 0) has been disconnected'
You only got one camera so try just use that one.
Well I guess there's your problem 'The given Camera device (id: 0) has been disconnected'
You only got one camera so try just use that one.
NO!I don't think so! When i use this API " useCameraDevices().length" get camera devices ,return two
Did you Setup the CodeScanner properly? It needs google play services to download the MLKit model.
Try changing this line in node_modules/react-native-vision-camera/android/build.gradle
:
to
implementation 'com.google.mlkit:barcode-scanning:17.2.0'
then rebuild your app and see if that works then.
To anyone who has no idea what @mrousavy is suggesting:
Did you Setup the CodeScanner properly? It needs google play services to download the MLKit model.
I think by default Mi6 does not have Google Play services installed/enabled so the it needs to an apk with preloaded models otherwise MLKit won't work.
Did you Setup the CodeScanner properly? It needs google play services to download the MLKit model.
Thanks! I have configured!It don't work!
To anyone who has no idea what @mrousavy is suggesting:
Did you Setup the CodeScanner properly? It needs google play services to download the MLKit model.
I think by default Mi6 does not have Google Play services installed/enabled so the it needs to an apk with preloaded models otherwise MLKit won't work.
only Mi6 has this problem,other phone is work(vivo phone).when i using the old lib react-native-camera ,Mi6 is ok ,
They're doing nothing really different than I am as far as I can tell - I#m just using a newer version of the library. https://github.com/react-native-camera/react-native-camera/blob/master/android/src/mlkit/java/org/reactnative/barcodedetector/RNBarcodeDetector.java
@wublack are you 100% sure that you changed the line in the build.gradle
file, synced your project (gradle sync in Android Studio), and then rebuilt the app and it still didn't work?
I am pretty sure ! I remove the "node_module" folder ,try again it's didn't work! If the build.gradle file is not config, error listener will also prompt, right! But there is no prompt in the log.@mrousavy
So I guess MLKit just doesn't work on that phone then? I don't know, doesn't seem like there's anything I can do here.
I could use ZXing instead of MLKit on Android, but I heard that's slower.
@wublack you can try to build a native Java Android app and try if MLKit works on that phone by following this guide.
So I guess MLKit just doesn't work on that phone then? I don't know, doesn't seem like there's anything I can do here.
I could use ZXing instead of MLKit on Android, but I heard that's slower.
@wublack you can try to build a native Java Android app and try if MLKit works on that phone by following this guide.
Thanks! I try it,but it's worked on Mi6 ,using camerax+mlkit ,I feel very frustrated !
Thanks! It's my code bug ! const isFocused = useIsFocused();
the Bugs will appear when i using constant isFocused. The components has not refresh! But I don't know why ios phone and other android phone refresh component when i using constant isFocused.
🙃
Try changing this line in
node_modules/react-native-vision-camera/android/build.gradle
:to
implementation 'com.google.mlkit:barcode-scanning:17.2.0'
then rebuild your app and see if that works then.
Thank you very much. The QR code can be recognized, but the screen will appear black when back
What's happening?
I wanted to scan qrcode by the lib,but it did not work.on Mi6 Android 9 MIUI11.0.5.The same code run vivo phone(android 13) is ok!
Reproduceable Code
Relevant log output
Camera Device
Device
Mi6
VisionCamera Version
3.3.1
Can you reproduce this issue in the VisionCamera Example app?
No, I cannot reproduce the issue in the Example app
Additional information