shifeng1993 / react-native-qr-scanner

一个二维码扫描组件,依赖react-native-camera
MIT License
116 stars 65 forks source link

QRCode Reader from Android Gallery Crash #31

Closed ghost closed 5 years ago

ghost commented 5 years ago

After select photo from Library, the app crash on android device only. Error: "Cannot read property 'readerQR' of undefined". And the Path is there, please check below:

data:"iVBORw0KGgoA..." fileName:"52962324993480.png" fileSize:34969 height:1313 isVertical:true originalRotation:0 path:"/storage/emulated/0/Download/52962324993480.png" type:"image/png" uri:"content://media/external/images/media/193282" width:1080

code: accessGallery = () => { ImagePicker.launchImageLibrary({}, response => { console.log(response); if (response.error) { Alert.alert(response.error); return; } if (response.uri) { let path = response.path; if (!path) { path = response.uri; } console.log(path); QRreader(path) .then(data => { this.onSuccess({ data: data }); }) .catch(() => { Alert.alert(localizeString('QRCode.invalidImage')); }); } }); };

Any Solution ?

nongh4704 commented 5 years ago

So you get the data but is crash?

ghost commented 5 years ago

Hi @nongh90 it was a missing in the Android Packages(), Thank you