-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invariant Violation: requireNativeComponent: "RNCWebView" was not found in the UIManager. #140
Comments
I'm using Expo as well. Are they the same issue? If it is, how do I use the new webview component without Expo? |
If I can't use Expo with this component, maybe I can just go ahead and use the old webview component assuming that Expo will eventually support it and then later switch to this one before RN removes the old one? I really would prefer not to have to do all the complicated Android Studio/Xcode setup work. I have Expo working just fine for everything else and think it's quite convenient.... |
I am not using expo and am running into this. |
Hey folks, you won't be able to use this with Expo unless you eject. If you are not using Expo or you have already ejected and you're still getting this issue, it may be because you forgot to run If you're still having trouble, feel free to file another issue or update this one. Thanks! |
Closing the issue on the assumption that we're simply not following instructions is a bit premature. As I stated, I am not using Expo, and as I am capable of both understanding and following instructions, I did indeed run |
@lunarraid Apologies, did not intend to insinuate you're not following instructions. I closed the issue because the OP is using Expo and thus this particular issue is not relevant to your issue despite the similar error message. If you can provide a minimal reproduction of this problem please do file a new issue. |
@lunarraid I'm indeed interested in understanding what went wrong so please open an issue if you can provide a reproduction. |
If I can find some time I'll see if I can reproduce it in a blank project. If it helps, my project is using pods, and the initial install link failed. I was able to get the link step to not fail by adding the |
Ok, are you linking react with the pods or manually ? |
Same thing is happening here. I have ejected the project from expo, did the |
Are you using cocoapods @AndreevskiAleksandar ? |
Wait a minute RNCWebView does not exists, it's either RNCUIWebView or RNCWKWebView. There must be a bug 🤔 |
@Titozzz I have entries in my podfile for the react code, since
Annoyingly enough, I cannot reproduce this on a fresh project, though getting CocoaPods in general to work with react native (even on a fresh install) is such a pain in the rear. At the very least, using
was a requirement to get this working properly. Since I was unable to repro on a fresh project, I am going to assume that there is some library conflict or version issue that made the link step fail, and just keep my current manual link fix for my project. Feel free to hit me up if you have any more questions. |
That is weird given that I have nearly the same podfile 🤔 |
@Titozzz no, I am not using CocoaPods.. Its a direct eject from Expo, without any tinkering around with that (just followed the basic docs). After that I just linked it and made sure all the dependencies are in the gradle and settings file (I tested it for Android only). I ll take a look again at this in a few days.. |
So I did : and everythings work without cocoapods. On my project I use cocoapods without issues too. |
|
you probably did not add it inside the MainApplication.java import com.reactnativecommunity.webview.RNCWebViewPackage; and add new RNCWebViewPackage() to the packages list. This often fail if you change MainApplication too much (using wix native navigation for example) |
I tried spinning up a bare Expo app and ejecting immediately with ExpoKit, but got this error: `Task 'installDebug' not found in root project 'android'.`
So I'll wait for a repro to clone down first. |
Not using Expo, I still have the issue with Android even though my MainApplication.java is fixed and react-native-webview is linked. |
can you tell me more ? |
Experiencing this issue in ejected expo after a successful link (by running react-native link react-native-webview and then confirming that RNCWebViewPackage() is imported and linked in MainApplication.java as according to @Titozzz ). For myself the error is: "Invariant Violation: Invariant Violation: Invariant Violation: Native component for "RNCWebView" does not exist Going to investigate the source for the react-native-webview module to see if I can spot the problem. UPDATE: my issue was simply from putting webview inside another view in render. It needs to be returned on its own. |
How I got it to work with cocoapods: I went to manually link the library.
This seemed to work for me. Hope this helps any noobies such as myself. At first it didn't work. So then I unlinked it |
@mog3n You will likely need to remove the pod reference if you are linking under build phases. It didn't trigger for me, but this caused duplicate symbol errors for other people pulling down my project afterwards. Removing the pod reference fixed it for everyone. |
Mine works in IOS but I haven't been able to get it to work in android. I have already followed everything above and see these in my MainApplication file: import com.reactnativecommunity.webview.RNCWebViewPackage; Not really sure what else to try. Have trying rebuilding and linking many times. |
@Titozzz There is react-native-link for automatic linking. But there should be explain about manual linking. In our project automatic linking not working always(in Android), so I was needed the manual linking in MainApplication.java. That's why I am telling. The manual linking should be in readme. |
No, not seeing this part. Sorry. 🙃 it's my mistake. |
What should we update so that everyone sees it? |
You can update the brief details in readme instead of article link, then
give article link to follow details.
Piyalee Maiti
Thanks & Regards
…On Wed, 20 Mar 2019, 7:36 pm Thibault Malbranche, ***@***.***> wrote:
What should we update so that everyone sees it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#140 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATvL-ZWtOydPKC62Jlwy8N600-zTJlTlks5vYkBxgaJpZM4Yl_ti>
.
|
same issue in expo |
I was facing the similar issue Issue seems to be the dependent is not linked to your project, hence 2 solutions for this issue (depending on your 'dependency')
|
After trying so hard to make it yarn add react-native-webview react-native link react-native-webview, cd ios && pod install && cd .. |
@dennisclementino Do your podfile has the following line? |
I'm facing a similar issue:
react-native@0.61.x I'm using auto-link |
Hey, I'm facing a similar issue as well, following manual linking steps help me at least:
|
@itolegmysin I have tried the same as you did without changing react-native-config.js file and it succeeded. I think if you undo that file, it will work |
Clean your build file, this worked for me. |
I'm documenting how I got to this failure here in hopes to identify why this message occurs. Edit: I think it was the SDK. Posted solution here #140 (comment). Detailed steps that were NOT workingEdit: Posted solution here #140 (comment). From the Getting Started guide...
Next, I started using the LogRocket tutorial for setting up the WebView component.
I'm sure something above involves an out-of-place step or wrongly followed instructions, but due to the number of people affected by this, I feel there's something awry that's easy to stumble upon, or common steps to make mistake on. I'm a completely newbie at React Native, but I'm evaluating it against Java for a project. Note, I didn't know how to follow the above XCode fixes since I'm not using that as an IDE. If there's an equivalent for Android Studio, please let me know so that I can try it. 🍻 |
Update to the above...
... and now it works. Would the Android SDK cause this error? If so, why didn't it occur when running a vanilla React Native app? Edit: Apologies for all the details above, I was hoping that tracing steps would help others. 🥂 |
So I was running into this similar issue on android while converting an existing android app into a react native one, and my good friend @Afroholic78 realized that within the
I wasn't able to see this documented anywhere, but this is seemingly the only thing that fixed it for us! |
I was facing this same error, fixed it by re-running |
I think you did not link react-native-webview so link it first.
|
install react-native-screens work for me |
These steps worked for me:
Note: I'm using |
Same for me guys, it started with react-native-math-view, since I couldn't use it I wanted to move to this as a fallback. I DON'T THINK this is a webview problem itself, but a react one... |
Have you tried to link manually? Go to ../node_modules/react-native-webview/ios and drag and drop the RNCWebView.xcodeproj to Libraries folder on Xcode, right after, Go to Build Phases tab (on Xcode) in the section "Link binary With libraries" add the libRNCWebView.a (inside Libraries/RNCWebView.xcodeproj/Products). Try to build and run |
There is nothing left that I haven't tried for hours. restart project, restart macos, i try everything. but I still get the error "RNCWebView does not exist". |
same here |
I had a same issue. - "react-native-webview": "^13.10.5"
+ "react-native-webview": "^13.8.6" |
Run this on your terminal and reload the project |
Hi all, I'm new to React Native and I'm getting the error in the title.
Perhaps this is related to another previous post made 1 month ago:
" Invariant Violation: Native component for "RNCWKWebView does not exist" "
The text was updated successfully, but these errors were encountered: