react-native-qrcode-scanner icon indicating copy to clipboard operation
react-native-qrcode-scanner copied to clipboard

Can't Link

Open daniel031699 opened this issue 7 years ago • 10 comments

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",

daniel031699 avatar Aug 08 '18 07:08 daniel031699

I'm also experiencing this problem on iOS.

daniel-andersen avatar Aug 10 '18 11:08 daniel-andersen

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.

odelavia avatar Aug 13 '18 08:08 odelavia

@moaazsidat I am experiencing same. Did anyone find any solution?

ruchiigoyal avatar Aug 15 '18 00:08 ruchiigoyal

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

moaazsidat avatar Aug 15 '18 22:08 moaazsidat

@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 avatar Aug 15 '18 22:08 moaazsidat

@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. screen shot 2018-08-15 at 7 32 20 pm

odelavia avatar Aug 15 '18 23:08 odelavia

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.

screenshot 2018-09-02 at 23 37 31

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?

simonarcher avatar Sep 02 '18 21:09 simonarcher

As @simonarcher has pointed out, the problem is because there is no .xcodeproj file in the package.

passabilities avatar Sep 25 '18 00:09 passabilities

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

harrischelsea avatar Nov 22 '18 09:11 harrischelsea

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:

  1. Open your project in Xcode
  2. Select your Target
  3. Open "Build Phases" tab
  4. Remove libQRCode.a (I don't remember exact name) from "Link Binary With Libraries"
  5. Product --> Clean Build Folder
  6. Build and run again.

It worked for me.

DnEgorWeb avatar Jun 10 '19 07:06 DnEgorWeb