Michaelvilleneuve / react-native-document-scanner

Document scanner, features live border detection, perspective correction, image filters and more ! 📲📸
MIT License
843 stars 289 forks source link

RNPdfScanner was not found in the UIManager #60

Open theocikos opened 4 years ago

theocikos commented 4 years ago

Although the linking works in the ios devices on the android i get error : Invariant Violation: requireNativeComponent:"RNPdfScanner"was not found in the UIManager.I follow exactly the steps from readme but i can't get around this error.Thanks

alicancelik commented 4 years ago

@theocikos can you run it right for ios ? i am starting for android right now. If i do it i will text you

alicancelik commented 4 years ago

@theocikos did you solve it ?

theocikos commented 4 years ago

No i can't make it work :/ For ios it works fine.

bhaveshdaswani93 commented 4 years ago

I am try to run this on android using following config "react": "16.8.6", "react-native": "0.60.5", "react-native-document-scanner": "^1.4.2", And i am getting following error: Invariant Violation: requireNativeComponent: RNPdfScanner was not found in the UIManager

alicancelik commented 4 years ago

This package is not working in react-native 0.60 for android. I used rn-doc-scanner.

pnutmath commented 4 years ago

I am also facing same issue:
"react": "16.8.3", "react-native": "0.59.1", "react-native-document-scanner": "^1.4.2",

For iOS its working as expected. Great!

For Android, I followed exact same steps given in ReadMe file. Build is successful, but when I open component that contains DocumentScanner reference gets below error on application.

error-android-pdfscanner

Can someone please help on this or give direction?

CC: @Michaelvilleneuve

@theocikos - any luck on this issue?

theocikos commented 4 years ago

Sorry @pnutmath i didn't had any luck either.I am working on creating my own scanner

pnutmath commented 4 years ago

Okay @theocikos, let us know once you ready.. or need any help..

saidattax commented 4 years ago

Any update on this? @Michaelvilleneuve

I too get the same error. I'm using RN Version 0.59.10 and it doesn't work :(

ruby0888 commented 4 years ago

Having the same error. This package supports iOS only?

kubilaytural commented 4 years ago

I have the same error. Solution?

fuchien commented 4 years ago

I hava the same error in iOS. "react": "16.9.0", "react-native": "0.61.2", "react-native-document-scanner": "^1.4.2". Any solution? I didn't try on Android yet.

Pravesh701 commented 4 years ago

Invariant Violation: requireNativeComponent: RNPdfScanner was not found in the UIManager. Is anybody found the solution to this problem?

Michaelvilleneuve commented 4 years ago

Please try to use the version in master by doing

yarn add https://github.com/Michaelvilleneuve/react-native-document-scanner
mahendraios commented 4 years ago

Hi, I'm also getting the same error even for iOS! Invariant Violation: requireNativeComponent: RNPdfScanner was not found in the UIManager.

react-native : 0.61.5

Anybody has the solution?

mahendraios commented 4 years ago

No i can't make it work :/ For ios it works fine.

I'm unable to run it for iOS. Can you help me out

faheem121 commented 4 years ago

@Michaelvilleneuve can you please upload the example for android in index.android.js as you upload the example for ios in index.ios.js

nisargrthakkar commented 4 years ago

any update on this??

ananthu-confianz commented 4 years ago

+1

GitPointer commented 4 years ago

+1

hegdeMadan commented 4 years ago

+1

ssudekum commented 3 years ago

+1

shide1989 commented 3 years ago

+1

shide1989 commented 3 years ago

Usualy the "invariant violation" issue can indicate that you didn't run "react-native link" correctly. Can you give it a try ?

shrutigarg-reactnative commented 3 years ago

Did anyone get a solution for this ?

vinay37 commented 3 years ago

@Override protected List getPackages() { return Arrays.asList( new MainReactPackage(), new DocumentScannerPackage() //>>>> add this at MainApplication.java ); }

MuhammadKaleem171 commented 2 years ago

same issue here any update?

Adnan521 commented 2 years ago

On Android device: requireNativeComponent:"RNPdfScanner"was not found in the UIManager.I follow exactly the steps from readme but i can't get around this error.Thanks

maxizhukov commented 2 years ago

Any updates?

rsm23 commented 2 years ago

Any updates?

MoamberRaza commented 2 years ago

try: go to : node_modules/@woonivers/react-native-document-scanner/ios/RNPdfScannerManager.m

comment these line and build

// - (dispatch_queue_t)methodQueue // { // return dispatch_get_main_queue(); // }

zubairAbdullah27 commented 1 year ago

try: go to : node_modules/@woonivers/react-native-document-scanner/ios/RNPdfScannerManager.m

comment these line and build

// - (dispatch_queue_t)methodQueue // { // return dispatch_get_main_queue(); // }

not working for ios

kavypharma commented 1 year ago

Any updates? Using it in react-native: "0.71.1"

esthlosx commented 1 year ago

Hi @kavypharma . I migrated to react-native 0.71.x and it didn't work. There were two problems:

  1. The API of react native changed a little bit, and the old typescript implementation didn't work (i.e. removing device listeners). Some guy forked old version from woonivers and fixed the conflict - https://github.com/Andycapn/react-native-document-scanner
  2. For some reason, auto-linking didn't work for iOS.

Solution: Install and use the new version of document scanner: yarn add https://github.com/Andycapn/react-native-document-scanner

Make sure RNPdfScanner pod is installed. For me, auto-linking didn't worked, so I added it manually at the end of the Podfile: pod 'RNPdfScanner', path: '../node_modules/@andycapn/react-native-document-scanner/ios'

Also, for Android, don't forget to add the openCV library in settings.gradle: include ':openCVLibrary310' project(':openCVLibrary310').projectDir = new File(rootProject.projectDir,'../node_modules/@andycapn/react-native-document-scanner/android/openCVLibrary310')

Have a nice day.

ertan95 commented 6 months ago

Hi @kavypharma . I migrated to react-native 0.71.x and it didn't work. There were two problems:

  1. The API of react native changed a little bit, and the old typescript implementation didn't work (i.e. removing device listeners). Some guy forked old version from woonivers and fixed the conflict - https://github.com/Andycapn/react-native-document-scanner
  2. For some reason, auto-linking didn't work for iOS.

Solution: Install and use the new version of document scanner: yarn add https://github.com/Andycapn/react-native-document-scanner

Make sure RNPdfScanner pod is installed. For me, auto-linking didn't worked, so I added it manually at the end of the Podfile: pod 'RNPdfScanner', path: '../node_modules/@andycapn/react-native-document-scanner/ios'

Also, for Android, don't forget to add the openCV library in settings.gradle: include ':openCVLibrary310' project(':openCVLibrary310').projectDir = new File(rootProject.projectDir,'../node_modules/@andycapn/react-native-document-scanner/android/openCVLibrary310')

Have a nice day.

In my case the Xcode project's Libraries folder were empty and I additionally needed to manually add the native module RNPdfScanner, following these steps:

1. Find RNPdfScanner.xcodeproj:

Open Finder and navigate to the node_modules/@andycapn/react-native-document-scanner/iosdirectory in your React Native project, assuming you've already installed the library via npm or Yarn.

2. Open Your Xcode Project:

Open your React Native project in the ios folder by opening the .xcworkspace file with Xcode.

3. Add RNPdfScanner.xcodeproj to Libraries:

Right-click on the Libraries folder or an equivalent area in your Project Navigator within Xcode. Select Add Files to "YourProjectName"..., navigate to the desired directory (node_modules/@andycapn/react-native-document-scanner/ios), select the RNPdfScanner.xcodeproj file, and click Add.

4. Clean and Rebuild Your Project:

Select Product -> Clean Build Folder from the Xcode menu bar. Then rebuild your project by choosing Product -> Build or pressing the Play button in Xcode.

This process helped properly integrate the module into my project

MoamberRaza commented 4 months ago

confirm if you are using allProjects{} in build.gradle (project)