Skip to content

WebViewClientFlutterApiImpl.requestLoading: java.lang.NullPointerException #123004

Closed
@GeylanKalafMohe

Description

@GeylanKalafMohe

Steps to Reproduce

  1. Run the WebView Widget on Android from webview_flutter on this specs:

Device
Brand:Samsung
Model:Galaxy A53 5G
Orientation: Portrait
RAM free: 2.14 GB
Disk free: 68.61 GB
Operating System
Version:Android 13
Orientation: Portrait
Rooted:No
Crash

Expected results:
Should load the page normally

Actual results:
Crash with this logs in Firebase Crashlytics:

Fatal Exception: java.lang.NullPointerException:
       at java.util.Objects.requireNonNull(Objects.java:220)
       at io.flutter.plugins.webviewflutter.WebViewClientFlutterApiImpl.requestLoading(WebViewClientFlutterApiImpl.java:13)
       at io.flutter.plugins.webviewflutter.WebViewClientHostApiImpl$WebViewClientImpl.shouldOverrideUrlLoading(WebViewClientHostApiImpl.java:4)
       at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(AwContentsClientBridge.java:89)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:335)
       at android.os.Looper.loopOnce(Looper.java:186)
       at android.os.Looper.loop(Looper.java:313)
       at android.app.ActivityThread.main(ActivityThread.java:8741)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Code sample
WebViewWidget(controller: WebViewController()..loadRequest(Uri.parse('https://www.google.com')))
Logs
flutter doctor -v
[✓] Flutter (Channel stable, 3.7.7, on macOS 13.2.1 22D68 darwin-x64, locale en-SA)
    • Flutter version 3.7.7 on channel stable at /Users/geylankalafmohe/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2ad6cd72c0 (12 days ago), 2023-03-08 09:41:59 -0800
    • Engine revision 1837b5be5f
    • Dart version 2.19.4
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/geylankalafmohe/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

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

[✓] Connected device (3 available)
    • Dev iPad (mobile) • 00008101-000E40C80183001E • ios            • iOS 16.3.1 20D67
    • macOS (desktop)   • macos                     • darwin-x64     • macOS 13.2.1 22D68 darwin-x64
    • Chrome (web)      • chrome                    • web-javascript • Google Chrome 111.0.5563.64

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work lista: productionIssues experienced in live production appsc: crashStack traces logged to the consolec: fatal crashCrashes that terminate the processp: webviewThe WebView pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions