question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

simple popup with webview crashes on iOS

See original GitHub issue

Hi guys, need help with something, don’t know what is happening. I have a simple popup page in my xamarin form project:

<StackLayout  >
            <WebView x:Name="myWebView" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
            </WebView>
    </StackLayout>

Right now I’m passing the string url after InitializeComponent() in xaml.cs file: myWebView.Source = new UrlWebViewSource { Url = url};

And I call this within a TapGestureRecognizer Navigation.PushPopupAsync(new MyPopUpPage("https://my-url..."));

and I got the following error (nothing but this on stacktrace):

iOS[35217:341188] void _WebThreadLock(), 0x129b7b040: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now…

I already tried with the latest pre-release version (1.1.4.154-pre) on iOS but still has the same error. Any clue? What am I missing? This code is working fine on Droid, only has this error on iOS

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
balaameexcommented, Jul 25, 2018

I found the solution,

If you run in main thread will solve the issue as below.

Device.BeginInvokeOnMainThread(async () => { await Navigation.PushPopupAsync(page, false); });

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

WkwebView Crash On request audio & microphone pop up ...
I get an unknown error with WKWebView on my Iphone.When try to Change the navigation link inside the view the destination link request...
Read more >
Webview crashes when instantiating shared workers in IOS ...
Some of our users are facing crashes related to the webview when opening our app on IOS 16.1 devices, IOS 16.0 is not...
Read more >
Is anyone else experiencing crashes from webview : r/oneui
Android webview has been crashing my apps such as Discord and Samsung health. If someone knows a way to fix this please let...
Read more >
Camera Upload in Webview crashes app immediately
I have a webview where the user can upload an image. When you click the Choose button, IOS gives you 3 choices: Take...
Read more >
iOS Hybrid Remote app shows error popup or crashes on ...
I believe this crash is a memory management issue within the SDK, ... that I hold in the view controller that manages the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found