CRAlpha / react-native-wkwebview

WKWebview Component for React Native
MIT License
642 stars 271 forks source link

Blank screen on <WKWebview> #62

Open nicmar opened 7 years ago

nicmar commented 7 years ago

According to the docs it says "Try replacing your existing WebView with WKWebView and it should work in most cases."

This works: <WebView source={{uri: 'https://www.google.se/'}} />

This doesn't. It shows a white page with a red color on the left side, why is this? <WKWebView source={{uri: 'https://www.google.se/'}} />

i did import WKWebView from 'react-native-wkwebview-reborn'; and also added the files to Libraries in Xcode. I have react native 0.43.2.

image

image

insraq commented 7 years ago

Try taking look at the example project. You might be missing some flex:1

nicmar commented 7 years ago

Thanks, however with the example code, I get the same issue, but with "Reload" on the bottom. image

However the example had "react-native-cookies", which I had to remove to get it running at all.When I installed it according to the instructions, I get Apple Mach-O Linker Error when compiling for device when building in Xcode. image

When removing react-native-cookies the app started, but with the white screen/red line problem. And also the reload doesn't work, it gives this error: image

Any other ideas? :)

insraq commented 7 years ago

It seems that the OjbC files are not correct compiled and linked? Are you using the correct versions?

nicmar commented 7 years ago

Thank you, I found the error message: ld: warning: object file (/Users/niclas/Library/Developer/Xcode/DerivedData/Glossyday-hfuikwdujpqjbafwemyoeitvxizj/Build/Products/Debug-iphonesimulator/libRNCookieManagerIOS.a(RNCookieManagerIOS.o)) was built for newer iOS version (9.3) than being linked (8.0)

Our hope was to build an app that works with 8.0, does this mean that react-native-cookies don't work on older than 9.3? In that case I might just skip it. Or is it vital somehow?

Anyhow, even without the cookies addon, it still doesn't work, and just gives me the white page with the red line on the left. And this is with the exact code in the example, except the cookies addon.

matthiasdilger commented 7 years ago

Exact same issue with RN 0.44

nicmar commented 7 years ago

Weird, let me know if you find a solution. Are there any other WKWebview components?

insraq commented 7 years ago

I tested today on our test devices with example project but was unable to reproduce this error.

youshigay commented 7 years ago

also use RN 0.44, the same issue

hironarita commented 7 years ago

@nicmar Did you find a solution to this?

insraq commented 7 years ago

OK. I know what's the problem. Turns out the document is missing a step in manual linking process. You need to add the lib in linking phase. This is pretty common in manual linking process so I guess most pre RNPM devs sort of know how this works.

I will update README.

image

nicmar commented 7 years ago

Thanks, I never got it working, but I'll try this out when we get back to the project. We used Swift instead, due to this :)

hironarita commented 7 years ago

Great, thank you. I'm pretty sure rnpm link did all this, which is when I started getting the error from https://github.com/CRAlpha/react-native-wkwebview/issues/73. I'll try manually linking with the new steps later and report back.

zaguiini commented 6 years ago

+1. Using iOS 9.3, this component renders a blank screen :/

Funny thing is that it loads the content. I ran a test server that only alerts a message to the user and I got the message back on the app. What could it possibly be?

screen shot 2018-02-06 at 10 10 21
sinelanguage commented 6 years ago

I had this issue and for me it seems to be caused by not having dev tools open when running the app, once i installed react native debugger the stand alone rn debugger. Now RN wants to have dev tools open every single time. I haven't gotten around to deleting it from system (its installed with brew, not an npm package) to see if that solves it.

sinelanguage commented 6 years ago

update: So for me, if I was not using any remote debugger, whether it be in chrome, or standalone, I would get what I assumed was a blank webview, BUT it looks like for some reason, it just takes an arbitrary minute or so to render the DOM and then it renders, so I would say, depending on how complex your DOM is, try it again, first use remote debugging on, and see if it renders fast, and then turn it off, get your blank screen, and wait a minute to see if it shows up, mine did. If you build from your xcode project and not through RN CLI, you will see in the logs it parses the entire dom first in the logger, then renders it, that seems to be what the delay is...

tkserver commented 5 years ago

Hello @zaguiini have you solved this? I get a white screen, which is functional as the home page has 6 icons buttons on it. I can navigate to other screens and they display properly. Go back home, white screen.

zaguiini commented 5 years ago

Yes, I did. But it was a long time ago and I've quitted the company that I worked to at that time :/ Sorry man.

tkserver commented 5 years ago

If I set the scheme as debug it works great. If I set it to release, white home screen.

zaguiini commented 5 years ago

Are you sure the SSL certificate is okay, @tkserver? Don't forget that you can't use a regular HTTP connection on webviews in release mode!