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.31k stars 1.64k forks source link

App Crashed (InAppBrowserActivity.java line 34) #777

Closed shinsenter closed 3 years ago

shinsenter commented 3 years ago

Environment

Technology Version
Flutter version 1.27.0-5.0.pre.39
Plugin version 4.0.0
Android version 8~10
iOS version
Xcode version

Device information:

30% Sony
17% SHARP
15% FUJITSU
14% KYOCERA
12% HUAWEI
4% OUKITEL
4% Samsung
3% OPPO
<1% motorola

Description

Expected behavior: No crashes

Current behavior: From Firebase Crashlytics

Fatal Exception: java.lang.RuntimeException: Unable to destroy activity {com.pichillilorenzo.flutter_inappwebview.InAppBrowser.InAppBrowserActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.ViewGroup.removeView(android.view.View)' on a null object reference
       at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4963)
       at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4992)
       at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:44)
       at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2022)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:359)
       at android.app.ActivityThread.main(ActivityThread.java:7418)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.ViewGroup.removeView(android.view.View)' on a null object reference
       at com.pichillilorenzo.flutter_inappwebview.InAppBrowser.InAppBrowserActivity.dispose(InAppBrowserActivity.java:34)
       at com.pichillilorenzo.flutter_inappwebview.InAppBrowser.InAppBrowserActivity.onDestroy(InAppBrowserActivity.java)
       at android.app.Activity.performDestroy(Activity.java:8048)
       at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1342)
       at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4948)
       at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4992)
       at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:44)
       at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2022)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:359)
       at android.app.ActivityThread.main(ActivityThread.java:7418)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)

Steps to reproduce

Could not reproduce.

Images

Stacktrace/Logcat

github-actions[bot] commented 3 years ago

👋 @shinsenter

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!

pichillilorenzo commented 3 years ago

This is fixed with the new version 5. Version 4 is not supported anymore.

shinsenter commented 3 years ago

@pichillilorenzo Crashes also happened with the latest version #794

github-actions[bot] commented 1 month ago

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.