react-native-qrcode-scanner
react-native-qrcode-scanner copied to clipboard
Can't Link
Can't Link
What's happening?
i use link command,but there was no response
$ react-native link react-native-qrcode-scanner Scanning folders for symlinks in E:\workspace\AndroidWorkspace\Demo\node_modules (78ms)
Build details?
android 5.1 "react-native-qrcode-scanner": "^1.0.1", "react": "16.3.1", "react-native": "0.55.4",
I'm also experiencing this problem on iOS.
I am also getting the same error on IOS. I'm able to link and use the component on android no problem. After I attempt to link on IOS, I get a response telling me my assets have been linked to my IOS and Android project but nothing on my react-native-qrcode-scanner. I was able to previously link and get the component to work a month ago but I needed to do a fresh install because of some corrupted files and now I can't anymore.
@moaazsidat I am experiencing same. Did anyone find any solution?
Re: iOS Hey folks, I just tried a fresh clone of the demo project I use to test react-native-qrcode-scanner, and it seems to be working fine. Demo project: https://github.com/moaazsidat/react-native-qrcode-scanner-demo
For iOS, I would recommend making sure installation and setup is followed precisely, in particular, the migration bit for react-native-camera as outlined here is important: https://github.com/react-native-community/react-native-camera/blob/master/docs/migration.md
It makes the setup more complicated than I would have liked, but Apple/Xcode 🤷♂️ tings
@daniel-andersen Re: Android, it's possible that react-native link is no longer required because of the upgrade to react-native-camera a few months ago. is there an error being shown when you try to use the module in your project?
@moaazsidat I've tried following the installation instructions exactly for your library as well as that of react-native-camera and still can't link to react-native-qrcode-scanner. As a result of not being able to link to the library I get a TypeError: Cannot read propery "bindings" of null error when I try to to run my app. I've looked through the libraries available in my XCode project and the react-native-qrcode-scanner library doesn't show up. As a test, I've also tried installing the exact versions from your demo but I run into the same errors :/. I wonder if it's to do with an update that I don't know about yet somewhere else. I'll keep trying to debug and let you know if I have any insights.

Im not 100% sure how all this linking stuff works, but could it be because the react-native-qrcode-scanner package does not include the Xcode project in the source? I see the demo project mentioned above does have it.
I attempted to try manually link the library, but as such I couldn't find it after running the yarn add react-native-qrcode-scanner command in my project. Could this possibly be the issue?
As @simonarcher has pointed out, the problem is because there is no .xcodeproj file in the package.
You have to link it manually. Right click on Libraries and then: 1 "Add files to ..." 2 node_modules -> react-native-camera (react-native-permissions) -> ios -> .xcodeproj (for both libraries) 3 Then Build Settings -> Link Binary With Libraries -> Add libReactNativePermissions.a and libRNCamera.a 4 Build Settings -> Header Search Path -> Add $(SRCROOT)/../node_modules/react-native-camera/ios (recursive) and $(SRCROOT)/../node_modules/react-native-permissions/ios (recursive)
5 Run project
I had the same problem. First of all check all the points from the previous comment (linking manually). If you`re ok with that and everything is set, do the following:
- Open your project in Xcode
- Select your Target
- Open "Build Phases" tab
- Remove libQRCode.a (I don't remember exact name) from "Link Binary With Libraries"
- Product --> Clean Build Folder
- Build and run again.
It worked for me.