Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Crash in latest 5.4.3+4 - java.lang.NullPointerException: Attempt to invoke virtual method java.lang.String android.webkit.WebView.getUrl() #1168

Closed
4 tasks done
jeromeDms opened this issue Apr 29, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@jeromeDms
Copy link

Environment

Technology Version
Flutter version beta pre3
Plugin version 5.4.3+4
Android version 8.1.0
iOS version
Xcode version

Hi @pichillilorenzo

I just received a crashLytics report with the following trace :
Less important than the previous bugs, just one report from one user for now, among several thousands users.

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.webkit.WebView.getUrl()' on a null object reference
       at com.pichillilorenzo.flutter_inappwebview.in_app_browser.InAppBrowserActivity.onCreateOptionsMenu(InAppBrowserActivity.java:57)
       at android.app.Activity.onCreatePanelMenu(Activity.java:3388)
       at androidx.fragment.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:2)
       at androidx.appcompat.view.WindowCallbackWrapper.onCreatePanelMenu(WindowCallbackWrapper.java:2)
       at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.onCreatePanelMenu(AppCompatDelegateImpl.java:8)
       at androidx.appcompat.app.AppCompatDelegateImpl.preparePanel(AppCompatDelegateImpl.java:125)
       at androidx.appcompat.app.AppCompatDelegateImpl.doInvalidatePanelMenu(AppCompatDelegateImpl.java:61)
       at androidx.appcompat.app.AppCompatDelegateImpl$2.run(AppCompatDelegateImpl.java:22)
       at android.os.Handler.handleCallback(Handler.java:790)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       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)
@jeromeDms jeromeDms added the bug Something isn't working label Apr 29, 2022
@github-actions
Copy link

👋 @jeromeDms

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 pichillilorenzo changed the title Crash in latest 5.4.3+4 Android Crash in latest 5.4.3+4 - java.lang.NullPointerException: Attempt to invoke virtual method java.lang.String android.webkit.WebView.getUrl()' May 5, 2022
@pichillilorenzo pichillilorenzo changed the title Android Crash in latest 5.4.3+4 - java.lang.NullPointerException: Attempt to invoke virtual method java.lang.String android.webkit.WebView.getUrl()' Android Crash in latest 5.4.3+4 - java.lang.NullPointerException: Attempt to invoke virtual method java.lang.String android.webkit.WebView.getUrl() May 5, 2022
@pichillilorenzo
Copy link
Owner

Fixed with new release 5.4.3+5

@pichillilorenzo
Copy link
Owner

Added another fix with the new release 5.4.3+7

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants