Open pbwei opened 7 years ago
Same here
Solved mine by 'react-native upgrade' this make the necesary imports in MainApplication.java and MainActivity.java, these files will be overwritten, so you will need to 'react-native link' again, and reconfigure the gradle files for this one and any other plugins installed.
This error will be solved, however a few bugs with the android implementation will show up
but I have made another issue to show how to solve them.
check this #13
Im having the same issue. react-native upgrade doesnt help.
Same in iOS , how to solve this problem :( ! undefined is not an object ( evaluating BarcodeManager.barCodeTypes )
+1 iOS RN 0.47.1 RN CLI 2.0.1 react-native-smart-barcode 1.0.6
I use React Native 0.55.4 React 16.3.1 I fix by Remove folder android : rm -rf android then I generate folder android : react-native upgrade then : react-native link add Permission to AndroidManifest.xml uses-permission android:name="android.permission.CAMERA" uses-permission android:name="android.permission.VIBRATE" uses-feature android:name="android.hardware.camera" uses-feature android:name="android.hardware.camera.autofocus" and At file RCTCapturePackage.java I comment at @Override ( node_module/react-native-smart-barcode/android/src/main/java/com/reactnativecomponent/barcode/RCTCapturePackage.java ) //@Override public List<Class<? extends JavaScriptModule>> createJSModules() { return Collections.emptyList(); } It work for me I not config file MainApplication.java and MainActivity.java like At readme https://github.com/react-native-component/react-native-smart-barcode /// sorry I'm not good in English
Update : For React Native 0.43 + at node_module/react-native-smart-barcode/Barcode.js Use : import React, { Component } from 'react'; import PropTypes from 'prop-types';
<Barcode style={{ flex: 1, alignSelf: 'stretch', }}
ref={component => this._barCode = component}
barCodeTypes={['org.iso.QRCode']} // add this prop
onBarCodeRead={(event) => this._onBarCodeRead(event)} />
barCodeTypes=oneOf([ 0: "org.gs1.EAN-8" 1: "org.gs1.EAN-13" 2: "org.iso.Aztec" 3: "org.iso.QRCode" 4: "org.iso.PDF417" 5: "org.iso.Code128" 6: "org.iso.Code39" 7: "com.intermec.Code93" 8: "org.gs1.UPC-E" 9: "org.iso.Code39Mod43" ])
Same error in android