'RNCWebView' could not be found
Bug description:
To Reproduce:
ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNCWebView' could not be found. Verify that a module by this name is registered in the native binary. ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native. ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native. Expected behavior:
Screenshots/Videos:
Environment:
- OS:
- OS version:
- react-native version:"0.64.4"
- react-native-webview version:12.0.2"
Same issue
Same issue
I found the solution:
cd ios
/opt/homebrew/Cellar/cocoapods/1.12.1/bin/pod install
# you can also use pod install if pod is available for you.
If you could not find pod, you need to find the pod via whereis pod, in my cases it is said /opt/homebrew/bin/pod, but it is actually point to /opt/homebrew/Cellar/cocoapods/1.12.1/bin/pod.
I tried to add it to my $PATH, it is not working.
same issue with android ios work well
Does anybody have a solution to this, experiencing the same issue on android?
I have resolved it downgrade to v11.23.1
Same issue with android.
I have resolved it downgrade to v11.23.1
Worked for me ! Thanks @khanhtn91
If you are like me, and running your build from CLI instead of XCode directly, you can solve this by running the build once from XCode which seems to be needed to automatically link up the new Pods after updating to this newer version. Hope that helps someone.
Hi team, same issue with us.
we can not downgrade the react-native-webView version to. 11.23.1 . any other solution to resolve it?
OS: MacOS OS version: Android 12 and Android 13 react-native version:"0.64.4" react-native-webview version:12.0.2"
Bug description:
To Reproduce:
ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNCWebView' could not be found. Verify that a module by this name is registered in the native binary. ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native. ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
Downgrading to 12.1.0 works for me.
chez moi ce qu'a généré l'erreur c'est que certaines dépendances sont incompatibles avec la version d'expo installée : j'avais installé [email protected] Mais quand j'ai installé [email protected] mon code a fonctionné
Worked perfectly ! Thanks @gilluminate
If you are like me, and running your build from CLI instead of XCode directly, you can solve this by running the build once from XCode which seems to be needed to automatically link up the new Pods after updating to this newer version. Hope that helps someone.
In my case, I was on react-native: 0.66.1, and I guess the latest version of react-native-web-view is not compatible with old react-native version.
Downgrading to 11 version worked as @khanhtn91 mentioned.
yarn add react-native-webview@11
See also: https://github.com/react-native-webview/react-native-webview/pull/2686#issuecomment-1414603408
You need to mock the module
jest.mock('react-native-webview', () => ({
default: () => jest.fn() // or any mocked component instead of native view,
}))
https://github.com/react-native-webview/react-native-webview/pull/2686#issuecomment-1425865443
Same issue,
"react-native": 0.71.12,
"react-native-webview": 13.2.2,
"jest": "29.5.0"
What is the suggested Mock to interact with the component? I tried a simple Mock passing these props
{
goBack: jest.fn(),
goForward: jest.fn(),
reload: jest.fn(),
stopLoading: jest.fn(),
injectJavaScript: jest.fn(),
requestFocus: jest.fn(),
postMessage: jest.fn(),
clearFormData: jest.fn(),
clearCache: jest.fn(),
clearHistory: jest.fn(),
}
My Error just changed to
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
I have the same issue.
react-native: 0.70.4
react-native-webview: 12.1.0
same issue
"react-native": "0.71.8"
"react-native-webview": "^13.2.2",
"expo": "~48.0.18"
same issue in android , downgrade to 11.23.1 isn't working.
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNCWebView' could not be found. Verify that a module by this name is registered in the native binary. reportException @ ExceptionsManager.js:76 handleException @ ExceptionsManager.js:160 handleError @ setUpErrorHandling.js:24 reportFatalError @ error-guard.js:49 guardedLoadModule @ require.js:204 metroRequire @ require.js:128 (anonymous) @ appReducer.js:46 executeApplicationScript @ debuggerWorker.aca173c4.js:4 (anonymous) @ debuggerWorker.aca173c4.js:4
"react": "16.11.0", "react-native": "0.62.2", "react-native-webview": "12.1.0"
Same issue here:
Same issue here when running my tests:
"react": "18.2.0",
"react-native": "0.71.11",
"jest": "^29.2.1",
"react-native-webview": "^13.2.2",
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNCWebView' could not be found. Verify that a module by this name is registered in the native binary.
expo prebuild did nothing
but
npx react-native run-ios solved issue on ios
npx react-native run-android solved issue on android
expo prebuilddid nothing butnpx react-native run-iossolved issue on iosnpx react-native run-androidsolved issue on android
worked for me as well - thanks!
Same issue here
Manually linking react-native-webview fixed the issue in android
android/app/build.gradle
android/app/src/main/java/earth/wallet/app/MainApplication.java
android/settings.gradle
I have resolved it downgrade to v11.23.1
work for me, thanks
Is there anyone to solve this issue? I have met this bug when my android targer is 33
Same issue. Tried all
I have resolved it downgrade to v11.23.1
Worked for me. This is what I did: npx expo install react-native-webview@11.
When I try older version - it does not run at all. Like deprecated version - new version is community version, old one is. deprecated.