HarvestProfit / react-native-rectangle-scanner

React Native Document/Rectangle Scanner
MIT License
199 stars 62 forks source link

Invariant Violation: requireNativeComponent: "RNRectangleScanner" was not found in the UIManager. #114

Closed PremangiM closed 3 months ago

PremangiM commented 10 months ago

Working proper in Android. Getting error for the iOS.

"react-native": "0.71.10", "react": "18.2.0", "react-native-rectangle-scanner": "^1.0.10",

ismail-medhat commented 9 months ago

this issue appear with me after upgrade RN version from 0.66.1 to 0.73.2

tylerforsythe commented 7 months ago

For future searchers, the answer is to copy the RNRectangleScanner.podspec file from /node_modules/react-native-rectangle-scanner/ios up one directory to /node_modules/react-native-rectangle-scanner/. Then edit it so that it looks something like below. Note that line 3 the package.json changed from ../package.json. And line 19 the s.source_files value is different.

require 'json'

package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
  s.name           = 'RNRectangleScanner'
  s.version        = package['version']
  s.summary        = package['description']
  s.description    = package['description']
  s.license        = package['license']
  s.author         = package['author']
  s.homepage       = 'https://github.com/HarvestProfit/react-native-rectangle-scanner'
  s.source         = { git: 'https://github.com/HarvestProfit/react-native-rectangle-scanner.git', tag: s.version }

  s.requires_arc   = true
  s.platform       = :ios, '10.0'

  s.preserve_paths = 'README.md', 'package.json', 'index.js'
  s.source_files   = 'ios/**/*.{h,m}'

  s.dependency 'React'
end

Screenshot 2024-05-03 at 2 45 01 PM

humphreyja commented 3 months ago

This is fixed in #115 I'll be releasing an update to NPM in a bit, just finishing up our mobile app that uses it so I can test it on a few devices before pushing out that update.

Thanks for pointing it out!