pichillilorenzo / flutter_inappwebview

A Flutter plugin that allows you to add an inline webview, to use a headless webview, and to open an in-app browser window.
https://inappwebview.dev
Apache License 2.0
3.13k stars 1.45k forks source link

Webview is crashing #836

Open rahuldev91 opened 3 years ago

rahuldev91 commented 3 years ago

Environment

Technology Version
Flutter version 2.0.6
Plugin version 5.3.2
Android version 7
iOS version
Xcode version

Device information: Xioami OPPO LAVA

Description

Expected behavior: App should work in all devices

Current behavior: Webview is crashing on some devices, lots of crash logs are reported in crashlytics

Steps to reproduce

Unable to reproduce crash logs are coming for the play store app

Screenshot 2021-05-10 at 11 00 03 AM Screenshot 2021-05-10 at 11 01 12 AM

Logs

PhysicalDisplayAndroid.java line 97
org.chromium.ui.display.PhysicalDisplayAndroid.updateFromDisplay
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.Display.getSize(android.graphics.Point)' on a null object reference
       at org.chromium.ui.display.PhysicalDisplayAndroid.updateFromDisplay(PhysicalDisplayAndroid.java:97)
       at org.chromium.ui.display.DisplayAndroidManager$DisplayListenerBackendImpl.onDisplayChanged(DisplayAndroidManager.java:174)
       at android.hardware.display.DisplayManagerGlobal$DisplayListenerDelegate.handleMessage(DisplayManagerGlobal.java:553)
       at android.os.Handler.dispatchMessage(Handler.java:111)
       at android.os.Looper.loop(Looper.java:210)
       at android.app.ActivityThread.main(ActivityThread.java:5839)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1113)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:879)
github-actions[bot] commented 3 years ago

👋 @rahuldev91

NOTE: This comment is auto-generated.

Are you sure you have already searched for the same problem?

Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!

If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.

In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.

Following these steps can save you, me, and other people a lot of time, thanks!

And96 commented 3 years ago

For me, app crash when opened from external intent if Hybrid Composition is enabled.

mcmc2014 commented 3 years ago

I also have this problem,happened when the layout was resized

pansitwattana commented 2 years ago

This also happened to me. Crash on mostly Android 8.1 and lower version

Screen Shot 2564-10-25 at 10 20 45

Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.os.Bundle.getString(java.lang.String)' on a null object reference
       at com.pichillilorenzo.flutter_inappwebview.chrome_custom_tabs.ChromeCustomTabsActivity.onCreate(ChromeCustomTabsActivity.java:18)
       at android.app.Activity.performCreate(Activity.java:7009)
       at android.app.Activity.performCreate(Activity.java:7000)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
       at android.app.ActivityThread.-wrap11(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6494)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.os.Bundle.getString(java.lang.String)' on a null object reference
       at com.pichillilorenzo.flutter_inappwebview.in_app_browser.InAppBrowserActivity.onCreate(InAppBrowserActivity.java:13)
       at android.app.Activity.performCreate(Activity.java:7009)
       at android.app.Activity.performCreate(Activity.java:7000)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
       at android.app.ActivityThread.-wrap11(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6494)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)