Skip to content
New issue

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

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

Already on GitHub? # to your account

NPE when window.prompt #261

Closed
AlexV525 opened this issue Jan 16, 2020 · 3 comments
Closed

NPE when window.prompt #261

AlexV525 opened this issue Jan 16, 2020 · 3 comments

Comments

@AlexV525
Copy link
Contributor

Environment

Flutter version: 1.12.13+hotfix.5
Plugin version: 3.0.0 9c7ac0d
Android version: Android 10
Device information: OnePlus 6T

Description

Expected behavior: No NPE or crash.

Current behavior: App crashed when prompt was shown.

Steps to reproduce

  1. Running apps under debug environment.
  2. Open a web page including prompt function.
  3. Call window.prompt.
  4. App crashed.

Logcat

2020-01-16 15:06:38.623 4560-4560/com.alexv525.someapp E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.alexv525.someapp, PID: 4560
    java.lang.NullPointerException: Attempt to read from field 'android.view.WindowManager$LayoutParams android.view.ViewRootImpl.mWindowAttributes' on a null object reference
        at android.view.inputmethod.InputMethodManager.startInputInner(InputMethodManager.java:1638)
        at android.view.inputmethod.InputMethodManager.checkFocus(InputMethodManager.java:1889)
        at android.view.inputmethod.InputMethodManager.isActive(InputMethodManager.java:1196)
        at com.pichillilorenzo.flutter_inappwebview.InAppWebView.InputAwareWebView$1.run(InputAwareWebView.java:193)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7682)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

@AlexV525
Copy link
Contributor Author

AlexV525 commented Jan 16, 2020

As I investigate, this is related to flutter/flutter#38375 , but with an input field, the input method shown normally.

@AlexV525
Copy link
Contributor Author

AlexV525 commented Jan 16, 2020

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 Nov 10, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants