react-native-signature-canvas icon indicating copy to clipboard operation
react-native-signature-canvas copied to clipboard

Invariant Violation: requireNativeComponent: "RNCWebView" was not found in the UIManager

Open norenz92 opened this issue 5 years ago • 37 comments

Hi,

After Expo CLI update I now get the following red error:

Invariant Violation: requireNativeComponent: "RNCWebView" was not found in the UIManager.

I'm using react-native-webview 7.0.1

Any idea how to fix this?

norenz92 avatar Sep 18 '19 06:09 norenz92

Have the same issue using the latest version of expo sdk;

Edit: Tested using the examples in this project and they didnt work either.

RC1140 avatar Sep 19 '19 17:09 RC1140

only wait for expo sdk update,you can use [email protected].

YanYuanFE avatar Sep 20 '19 12:09 YanYuanFE

[email protected]. or 1.5.1 is not working for me. sdk 35 react-native-webview 7.0.1

TristanSkoda avatar Oct 07 '19 21:10 TristanSkoda

"react-native-webview": "^6.9.0",please use this version。

YanYuanFE avatar Oct 08 '19 01:10 YanYuanFE

Hi. Im also getting this error using ^6.9.0

uokesita avatar Nov 18 '19 12:11 uokesita

Hi. Im also getting this error using ^6.9.0

What's your react-native-signature-canvas version? Please use v1.5.0.

YanYuanFE avatar Nov 19 '19 07:11 YanYuanFE

same problem without Expo on using react-native-signature-canvas@^1.6.0 and react-native-webview@^7.5.2: version "7.6.0"

torstenloth avatar Dec 10 '19 11:12 torstenloth

Hi, @torstenloth .

You can try this example. https://github.com/YanYuanFE/react-native-signature-canvas/tree/master/example/exampleApp. this is a latest example of expo.

YanYuanFE avatar Dec 11 '19 01:12 YanYuanFE

im getting the same issue as above and not really sure how to fix it:

my package.json contains this:

{ "dependencies": { "expo": "^36.0.0", "react": "16.9.0", "react-native": "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz", "react-native-signature-canvas": "^1.6.0", "react-native-webview": "7.4.3" // installed a compatible version using expo install react-native-webview } }

When you try use both the Signature AND the WebView at the same time (same component) it breaks with the error below: IMG_B95C9ADEC90A-1

Trashpants avatar Dec 12 '19 19:12 Trashpants

Hi, @Trashpants. "react-native-signature-canvas" has include "react-native-webview", You don't need extra installation.

YanYuanFE avatar Dec 13 '19 01:12 YanYuanFE

Hi @YanYuanFE,

So to give you the example of what Im trying to do - I Have a user read a web page (using a custom WebView Ive made) and then have a modal window where they need to add a signature.

Or to go even simpler I've put together this snack which shows the issue - hopefully it will make more sense with what im trying to do:

https://snack.expo.io/@trashpants/cfc43a

Trashpants avatar Dec 13 '19 11:12 Trashpants

Hi! @Trashpants, this issue caused by the react-native-webview in react-native-signature-canvas package.json version is not matched with your project package.json.

Change your package.json react-native-webivew version to react-native-signature-canvas's react-native-webview version will solve this issue.

YanYuanFE avatar Dec 16 '19 10:12 YanYuanFE

Hi @YanYuanFE , I'm trying to run a project with "react-native-webview": "^7.5.2" "react-native-signature-canvas": "^1.5.0" and I'm still getting this error. In addition, I've run your example and it is failing as well.

aibars avatar Jan 07 '20 17:01 aibars

Hi @aibars , You can try the lastest version of [email protected], and require expo sdk is latest.

YanYuanFE avatar Jan 08 '20 03:01 YanYuanFE

https://github.com/YanYuanFE/react-native-signature-canvas/tree/master/example/exampleApp, latest example

YanYuanFE avatar Jan 08 '20 03:01 YanYuanFE

This was a linking issue for me. I am not running expo. The issue comes from react-native-webview not being linked to your project properly (if you have not installed it directly in your app), as it gets installed as a dependency via this package.

My solution, as we use pods (in iOS), was to add:

pod 'react-native-webview', :path => '../node_modules/react-native-webview' to the podfile.

I imagine similar solutions exist for Android and Pure XCode users.

As I'm not a fan of react-native link (it's never really worked for me), I like to do it manually:

  • Android: https://engineering.brigad.co/demystifying-react-native-modules-linking-964399ec731b
  • iOS: https://facebook.github.io/react-native/docs/linking-libraries-ios
  • React-Native-Webview's docs: https://github.com/react-native-community/react-native-webview/blob/master/docs/Getting-Started.md

joshhogg avatar Jan 28 '20 17:01 joshhogg

Thanks @joshhogg your answer helped me.

uokesita avatar Feb 07 '20 19:02 uokesita

Facing the same issue in Android, but ios works after pod install.

"react-native": "0.61.5", "react-native-signature-canvas": "^1.9.0",

I tried react-native-signature-canvas with v1.9.0, v1.8.0, v1.5.1, both fail. I also tried to install the webview in my own project, still fail. I don't use expo, just pure react native project,

Since after rn 0.60, rn will auto-link the packages for Android. We suppose no need to link by ourselves.

If I manully link the webview followed @joshhogg suggestions, the build is fail due to error: react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java uses or overrides a deprecated API.

Thanks in advance.

luZheng-1122 avatar Feb 22 '20 00:02 luZheng-1122

I think it may be a bug in react-native-webview, and it doesn't work when I only use react-native-webview。

YanYuanFE avatar Feb 22 '20 13:02 YanYuanFE

Hi, @nengliangZ , You can only use react-native-webview for this example: import React, { Component } from 'react'; import { WebView } from 'react-native-webview';

class MyWeb extends Component { render() { return ( <WebView source={{ uri: 'https://infinite.red' }} style={{ marginTop: 20 }} /> ); } }

YanYuanFE avatar Feb 22 '20 13:02 YanYuanFE

yarn add react-native-webview will solve the problem

imchathu87 avatar Apr 29 '20 02:04 imchathu87

Still getting this issue on Expo 36, but only on iOS signature-canvas: "^1.9.0"

matt-simpleclick avatar May 27 '20 09:05 matt-simpleclick

you can try to use the latest version: v2.6.0.

YanYuanFE avatar May 28 '20 02:05 YanYuanFE

I had the latest version originally and that didn't work either. It does seem to have magically fixed itself now though, without me changing anything

matt-simpleclick avatar May 28 '20 08:05 matt-simpleclick

OK, Good.

YanYuanFE avatar May 28 '20 08:05 YanYuanFE

same error here :( "react-native-signature-canvas": "^3.0.0", "react-native-webview": "^10.3.2",

error

erikhu avatar Jul 17 '20 16:07 erikhu

Hey @erikhu I solved doing this:

I run yarn add react-native-webview then pod install

apparently, the webview that comes within react-native-signature-canvas doesn't link with pod install.

my project:

"react-native": "0.63.0",
"react-native-signature-canvas": "^3.0.0",

enrickdl avatar Jul 23 '20 18:07 enrickdl

I'm hitting this error with near latest and I fixed it by install react-native-webview manually which seems to have fixed a dependency linking problem on android

"react-native": "0.63.1",
"react-native-signature-canvas": "^3.1.0",
// installed this after experiencing the problem
"react-native-webview": "^11.0.0",

slightlytyler avatar Nov 30 '20 20:11 slightlytyler

i have the same error "react-native": "^0.59.5",

"react-native-signature-canvas": "^3.3.0", "react-native-webview": "^11.0.2",

Guilleanto avatar Dec 15 '20 00:12 Guilleanto

@Guilleanto , try "react-native-webview": "^10.9.0"

YanYuanFE avatar Dec 15 '20 02:12 YanYuanFE