Medardas
Medardas

Reputation: 540

app crash on Android 5.0.x

i'm having an issue of application crashing on android versions 5.0.X. No error available, just this warning:

06-19 11:50:22.900: W/google-breakpad(24934):
Chrome build fingerprint:
1.4.4
11
5c230f07-455f-4c1f-91eb-9c44019cd813
### ### ### ### ### ### ### ### ### ### ### ### ###
Tombstones are disabled on JB MR2+ user builds.
### ### ### ### ### ### ### ### ### ### ### ### ###

Sometimes it crashes even without clicking anything. version 5.1 and version below 5 do work normally. ANy idea what might be wrong?

Found similar issue here but Xamarin is used there.

Upvotes: 4

Views: 1132

Answers (1)

Marian
Marian

Reputation: 375

I had exactly the same error in Xamarin.Android and was able to solve the problem with this fix. Just add this to the Fragment which holds the WebView:

public override void OnDetach()
    {
        base.OnDetach();
        DestroyWebView();
    }

    public void DestroyWebView()
    {
        var webView = Activity.FindViewById<WebView>(Resource.Id.webView);
        if(webView != null) 
        {
            webView.ClearHistory();
            webView.ClearCache(true);
            webView.LoadUrl("about:blank");
            #pragma warning disable 618, 414
            webView.FreeMemory(); 
            #pragma warning restore 618, 414
        }
    }

Upvotes: 1

Related Questions