Skip to content

webview_flutter crash: Attempt to invoke virtual method 'void android.view.Display.getSize(android.graphics.Point)' on a null object reference #30420

@embpdaniel

Description

@embpdaniel

Hi, I have a simple app using Firebase, that displays a webview from webview_flutter on my home screen after I log in. When I navigate to the home screen to load the webview, the app crashes. However, if I reload the app after I'm logged in, the app starts at the home page, and the webview loads fine.

Steps to Reproduce

  1. Make sure you are logged out, then log in
  2. The app will navigate to the home page
  3. The home page appears to load, but when the webview loads the app crashes
  4. Reloading the app at this point will allow the webview to load without errors

Logs

[   +6 ms] D/EGL_emulation(24191): eglMakeCurrent: 0xb1db2f40: ver 3 0 (tinfo 0xa8983200)
[  +64 ms] D/        (24191): SurfaceInterface::setAsyncMode: set async mode 1
[  +13 ms] W/zygote  (24191): Attempt to remove non-JNI local reference, dumping thread
[   +7 ms] D/EGL_emulation(24191): eglMakeCurrent: 0xa5d6f0c0: ver 3 0 (tinfo 0x93288890)
[ +119 ms] D/EGL_emulation(24191): eglMakeCurrent: 0xb1db2f40: ver 3 0 (tinfo 0xa8983200)
[   +7 ms] W/zygote  (24191): Attempt to remove non-JNI local reference, dumping thread
[ +162 ms] D/        (24191): SurfaceInterface::setAsyncMode: set async mode 1
[   +3 ms] D/AndroidRuntime(24191): Shutting down VM
[        ] E/AndroidRuntime(24191): FATAL EXCEPTION: main
[        ] E/AndroidRuntime(24191): Process: com.embp.browse, PID: 24191
[        ] E/AndroidRuntime(24191): java.lang.NullPointerException: Attempt to invoke virtual method
'void android.view.Display.getSize(android.graphics.Point)' on a null object reference
[        ] E/AndroidRuntime(24191):     at
org.chromium.ui.display.PhysicalDisplayAndroid.updateFromDisplay(PhysicalDisplayAndroid.java:97)
[        ] E/AndroidRuntime(24191):     at
org.chromium.ui.display.DisplayAndroidManager$DisplayListenerBackendImpl.onDisplayChanged(DisplayAndroid
Manager.java:174)
[        ] E/AndroidRuntime(24191):     at
android.hardware.display.DisplayManagerGlobal$DisplayListenerDelegate.handleMessage(DisplayManagerGlobal
.java:482)
[        ] E/AndroidRuntime(24191):     at android.os.Handler.dispatchMessage(Handler.java:105)
[        ] E/AndroidRuntime(24191):     at android.os.Looper.loop(Looper.java:164)
[   +4 ms] E/AndroidRuntime(24191):     at android.app.ActivityThread.main(ActivityThread.java:6541)
[        ] E/AndroidRuntime(24191):     at java.lang.reflect.Method.invoke(Native Method)
[        ] E/AndroidRuntime(24191):     at
com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
[        ] E/AndroidRuntime(24191):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

No issues found with flutter analyze command

Flutter doctor

(I'm using vscode, and not developing for iOS at the moment)

[✓] Flutter (Channel stable, v1.2.1, on Mac OS X 10.14 18A391, locale en-US)
    • Flutter version 1.2.1 at /Users/naneco/flutter-sdk-1.0.0
    • Framework revision 8661d8aecd (7 weeks ago), 2019-02-14 19:19:53 -0800
    • Engine revision 3757390fa4
    • Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/naneco/android-sdk-macosx
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/naneco/android-sdk-macosx
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[!] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    ✗ Verify that all connected devices have been paired with this computer in Xcode.
      If all devices have been paired, libimobiledevice and ideviceinstaller may require updating.
      To update with Brew, run:
        brew update
        brew uninstall --ignore-dependencies libimobiledevice
        brew uninstall --ignore-dependencies usbmuxd
        brew install --HEAD usbmuxd
        brew unlink usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    • ios-deploy 1.9.4
    • CocoaPods version 1.5.3

[!] Android Studio (version 3.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[!] IntelliJ IDEA Ultimate Edition (version 2017.2.7)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.io/intellij-setup/#installing-the-plugins

[✓] VS Code (version 1.32.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.25.0

[✓] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.0.0 (API 26) (emulator)

App files:
files.zip

Thanks in advance!

Metadata

Metadata

Assignees

Labels

a: platform-viewsEmbedding Android/iOS views in Flutter appsc: crashStack traces logged to the consolecustomer: quill (g3)dependency: androidAndroid team may need to help usp: webviewThe WebView pluginpackageflutter/packages repository. See also p: labels.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions