EAS build RNCWebView not found

Hello,
I’m using EAS because my app targets age of 13 and under.
I’m using expo 42, managed.
Everything is fine but only a page I’m using RNCWebView throws an error and crashes the app.
The error is:

com.facebook.react.common.JavascriptException: Invariant Violation: requireNativeComponent: "RNCWebView" was not found in the UIManager.

It’s working fine with the classic build, but I need EAS. I’m using react-native-draw-on-screen and I guess this uses RNCWebView.
Any ideas how can I fix it?
Thanks

Have you tried installing react-native-webview?

FWIW, I can reproduce the problem. Just building now after manually installing react-native-webview, but not sure why that should be necessary.

Maybe it’s a version issue? v11.6.2 with expo install react-native-webview, but v9.4.0 when installed as a dependency of react-native-draw-on-screen.

% yarn why react-native-webview
yarn why v1.22.11
[1/4] 🤔  Why do we have the module "react-native-webview"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "react-native-webview@11.6.2"
info Has been hoisted to "react-native-webview"
info This module exists because it's specified in "dependencies".
info Disk size without dependencies: "764KB"
info Disk size with unique dependencies: "820KB"
info Disk size with transitive dependencies: "880KB"
info Number of shared dependencies: 4
=> Found "react-native-draw-on-screen#react-native-webview@9.4.0"
info This module exists because "react-native-draw-on-screen" depends on it.
info Disk size without dependencies: "608KB"
info Disk size with unique dependencies: "664KB"
info Disk size with transitive dependencies: "724KB"
info Number of shared dependencies: 4
✨  Done in 0.22s.

EDIT: I can confirm that it works for me after I expo install react-native-webview.

react-native libraries should not add other native dependencies in their dependencies, because they are not autolinked unless they are included in the dependencies of the project’s package.json (ie: transitive dependencies are not autolinked). so, you need to install react-native-webview with expo install react-native-webview.

the reason it works with the classic build system is that every api in the expo sdk is included in your app (the downside, of course, being that your app is much larger and less customizable in this case)

1 Like

Now is working perfect. Thanks to all.