react-native-sketch-draw icon indicating copy to clipboard operation
react-native-sketch-draw copied to clipboard

Invariant Violation: Native component for "RNSketchView" does not exist

Open tmehta2442 opened this issue 6 years ago • 9 comments

Environment: OS: macOS High Sierra 10.13.4 Node: 9.5.0 Yarn: 1.3.2 npm: 5.6.0 Watchman: Not Found Xcode: Xcode 9.3.1 Build version 9E501 Android Studio: 3.1 AI-173.4720617

Packages: (wanted => installed) react: 16.3.1 => 16.3.1 react-native: ^0.55.4 => 0.55.4

I have also just replaced my page with the example given ("Usage" @ https://github.com/VGamezz19/react-native-sketch-draw), just to make sure i wasn't doing anything else crazy.

Steps to reproduce

  1. npm start
  2. expo app opens up
  3. after going to view in question, get the following error in the big ugly red error view :)

Invariant Violation: Native component for "RNSketchView" does not exist This error is located at: in RNSketchView (at index.js:53) in SketchView (at SelectVehicleScreen.js:55) in RCTView (at View.js:60) in View (at SelectVehicleScreen.js:54) in SelectVehicleScreen (at SceneView.js:10) in SceneView (at StackViewLayout.js:424) in RCTView (at View.js:60) in View (at StackViewLayout.js:423) in RCTView (at View.js:60) in View (at StackViewLayout.js:422) in RCTView (at View.js:60) in View (at createAnimatedComponent.js:154) in AnimatedComponent (at StackViewCard.js:12) in Card (at createPointerEventsContainer.js:28) in Container (at StackViewLayout.js:484) in RCTView (at View.js:60) in View (at StackViewLayout.js:381) in RCTView (at View.js:60) in View (at StackViewLayout.js:380) in StackViewLayout (at withOrientation.js:30) in withOrientation (at StackView.js:61) in RCTView (at View.js:60) in View (at Transitioner.js:146) in Transitioner (at StackView.js:22) in StackView (at createNavigator.js:96) in Navigator (at createKeyboardAwareNavigator.js:11) in KeyboardAwareNavigator (at createNavigationContainer.js:366) in NavigationContainer (at App.js:42) in App (at registerRootComponent.js:35) in RootErrorBoundary (at registerRootComponent.js:34) in ExpoRootComponent (at renderApplication.js:33) in RCTView (at View.js:60) in View (at AppContainer.js:102) in RCTView (at View.js:60) in View (at AppContainer.js:122) in AppContainer (at renderApplication.js:32)

I can see in the react-native-sketch-draw's node_module, inside index.js at line 107 the following: let RNSketchView = requireNativeComponent('RNSketchView', SketchView, { nativeOnly: { onChange: true } }); so not sure why I am getting the error!

Any help is appreciated.

tmehta2442 avatar May 29 '18 18:05 tmehta2442

Same issue here.

MilanDemarcq avatar Aug 06 '18 11:08 MilanDemarcq

Having the same problem here, has anyone found a work around?

hecmonn avatar Jan 04 '19 17:01 hecmonn

Always same here ^^

omgprod avatar Jul 02 '19 02:07 omgprod

Yep, simply doens't work anymore

jasonnathan avatar Aug 15 '19 14:08 jasonnathan

Any work around ?

taimurmushtaq avatar Sep 13 '19 15:09 taimurmushtaq

Same issue

jvink avatar Nov 28 '19 10:11 jvink

Same issue

jamzrob avatar Dec 04 '19 00:12 jamzrob

I had this same issue but realized I had forgotten a step in the install instructions on the readme. You need to add the SketchViewContainer.xib file to the 'Copy Bundle Resouces' build step.

  1. Open Xcode and open the top-level config for your project (in the file view, the top line with the little blueprint icon)
  2. Select the 'Build Phases' tab
  3. Scroll down to and expand the 'Copy Bundle Resources' tab.
  4. Click the '+' button at the bottom of the list.
  5. Navigate to node_modules/react-native-sketch-draw/ios/SketchView and add SketchViewContainer.xib to the project. Note: you might need to go up a folder as I think the default behavior for xcode is to only show you folders below the ios/ folder for your app and node_modules is likely a sibling of that folder. After that, it should build. Hope that helps

Chris-McGowan-Vector avatar Dec 26 '19 16:12 Chris-McGowan-Vector

@Chris-McGowan-Vector even after doing that its not working. Any other solutions or library that you would recommend?

prayaslashkari avatar Dec 23 '20 19:12 prayaslashkari