Skip to content

Unable to use on Android New version #343

@atrope

Description

@atrope

Environment

Flutter version: 1.7
Plugin version: 3.1.0
Android version: Android 10
iOS version:
Xcode version:
Device information: Galaxy S10

Description

When trying to use the Simple inAppWebview app the plugin returns the following error:

E/MethodChannel#flutter/platform_views(32251): Failed to handle method call
E/MethodChannel#flutter/platform_views(32251): java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
E/MethodChannel#flutter/platform_views(32251): 	at android.view.ViewConfiguration.get(ViewConfiguration.java:491)
E/MethodChannel#flutter/platform_views(32251): 	at android.view.View.<init>(View.java:5440)
E/MethodChannel#flutter/platform_views(32251): 	at android.view.View.<init>(View.java:5632)
E/MethodChannel#flutter/platform_views(32251): 	at android.view.ViewGroup.<init>(ViewGroup.java:677)
E/MethodChannel#flutter/platform_views(32251): 	at android.widget.AbsoluteLayout.<init>(AbsoluteLayout.java:56)
E/MethodChannel#flutter/platform_views(32251): 	at android.webkit.WebView.<init>(WebView.java:410)
E/MethodChannel#flutter/platform_views(32251): 	at android.webkit.WebView.<init>(WebView.java:353)
E/MethodChannel#flutter/platform_views(32251): 	at android.webkit.WebView.<init>(WebView.java:336)
E/MethodChannel#flutter/platform_views(32251): 	at android.webkit.WebView.<init>(WebView.java:323)
E/MethodChannel#flutter/platform_views(32251): 	at android.webkit.WebView.<init>(WebView.java:313)
E/MethodChannel#flutter/platform_views(32251): 	at com.pichillilorenzo.flutter_inappwebview.InAppWebView.InputAwareWebView.<init>(InputAwareWebView.java:28)

Steps to reproduce

Simple statelesswidget
with:


InAppWebView(
                  initialUrl: "http://www.google.com",
                  initialOptions: InAppWebViewGroupOptions(
                    android: AndroidInAppWebViewOptions(
                      domStorageEnabled: true,
                    ),
                    ios: IOSInAppWebViewOptions(),
                    crossPlatform: InAppWebViewOptions(
                      debuggingEnabled: false,
                    ),
                  ),
                  onWebViewCreated: (InAppWebViewController controller) =>
                      webView = controller,
                ),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions