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

Crash on webview start. #357

Closed
RomanKapshuk opened this issue May 21, 2020 · 13 comments
Closed

Crash on webview start. #357

RomanKapshuk opened this issue May 21, 2020 · 13 comments

Comments

@RomanKapshuk
Copy link

RomanKapshuk commented May 21, 2020

Environment

Flutter version: 1.17
Plugin version: 3.2.0
Android version: Any
iOS version:
Xcode version:
Device information: Any real or simulator

Description

Expected behavior: Should open web view on Android (iOS just fine)

Current behavior: Crash on web view start. Plugin v2.1.0+1 works fine.

Steps to reproduce

  1. Open web view

Images:

image

Stacktrace/Logcat

E/MethodChannel#flutter/platform_views(10176): Failed to handle method call E/MethodChannel#flutter/platform_views(10176): 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(10176): at android.view.ViewConfiguration.get(ViewConfiguration.java:447) E/MethodChannel#flutter/platform_views(10176): at android.view.View.<init>(View.java:4806) E/MethodChannel#flutter/platform_views(10176): at android.view.View.<init>(View.java:4948) E/MethodChannel#flutter/platform_views(10176): at android.view.ViewGroup.<init>(ViewGroup.java:659) E/MethodChannel#flutter/platform_views(10176): at android.widget.AbsoluteLayout.<init>(AbsoluteLayout.java:55) E/MethodChannel#flutter/platform_views(10176): at android.webkit.WebView.<init>(WebView.java:659) E/MethodChannel#flutter/platform_views(10176): at android.webkit.WebView.<init>(WebView.java:604) E/MethodChannel#flutter/platform_views(10176): at android.webkit.WebView.<init>(WebView.java:587) E/MethodChannel#flutter/platform_views(10176): at android.webkit.WebView.<init>(WebView.java:574) E/MethodChannel#flutter/platform_views(10176): at android.webkit.WebView.<init>(WebView.java:564) E/MethodChannel#flutter/platform_views(10176): at com.pichillilorenzo.flutter_inappwebview.InAppWebView.InputAwareWebView.<init>(InputAwareWebView.java:28) E/MethodChannel#flutter/platform_views(10176): at com.pichillilorenzo.flutter_inappwebview.InAppWebView.InAppWebView.<init>(InAppWebView.java:559) E/MethodChannel#flutter/platform_views(10176): at com.pichillilorenzo.flutter_inappwebview.InAppWebView.FlutterWebView.<init>(FlutterWebView.java:63) E/MethodChannel#flutter/platform_views(10176): at com.pichillilorenzo.flutter_inappwebview.InAppWebView.FlutterWebViewFactory.create(FlutterWebViewFactory.java:28) E/MethodChannel#flutter/platform_views(10176): at io.flutter.plugin.platform.SingleViewPresentation.onCreate(SingleViewPresentation.java:179) E/MethodChannel#flutter/platform_views(10176): at android.app.Dialog.dispatchOnCreate(Dialog.java:407) E/MethodChannel#flutter/platform_views(10176): at android.app.Dialog.show(Dialog.java:302) E/MethodChannel#flutter/platform_views(10176): at android.app.Presentation.show(Presentation.java:249) E/MethodChannel#flutter/platform_views(10176): at io.flutter.plugin.platform.VirtualDisplayController.<init>(VirtualDisplayController.java:94) E/MethodChannel#flutter/platform_views(10176): at io.flutter.plugin.platform.VirtualDisplayController.create(VirtualDisplayController.java:47) E/MethodChannel#flutter/platform_views(10176): at io.flutter.plugin.platform.PlatformViewsController$1.createPlatformView(PlatformViewsController.java:112) E/MethodChannel#flutter/platform_views(10176): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:95) E/MethodChannel#flutter/platform_views(10176): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59) E/MethodChannel#flutter/platform_views(10176): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226) E/MethodChannel#flutter/platform_views(10176): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) E/MethodChannel#flutter/platform_views(10176): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631) E/MethodChannel#flutter/platform_views(10176): at android.os.MessageQueue.nativePollOnce(Native Method) E/MethodChannel#flutter/platform_views(10176): at android.os.MessageQueue.next(MessageQueue.java:326) E/MethodChannel#flutter/platform_views(10176): at android.os.Looper.loop(Looper.java:160) E/MethodChannel#flutter/platform_views(10176): at android.app.ActivityThread.main(ActivityThread.java:6669) E/MethodChannel#flutter/platform_views(10176): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#flutter/platform_views(10176): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) E/MethodChannel#flutter/platform_views(10176): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) E/flutter (10176): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference, null) E/flutter (10176): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7) E/flutter (10176): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18) E/flutter (10176): <asynchronous suspension> E/flutter (10176): #2 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12) E/flutter (10176): #3 AndroidViewController._create (package:flutter/src/services/platform_views.dart:633:54) E/flutter (10176): #4 AndroidViewController.setSize (package:flutter/src/services/platform_views.dart:550:14) E/flutter (10176): #5 RenderAndroidView._sizePlatformView (package:flutter/src/rendering/platform_view.dart:175:29) E/flutter (10176): #6 RenderAndroidView.performResize (package:flutter/src/rendering/platform_view.dart:156:5) E/flutter (10176): #7 RenderObject.layout (package:flutter/src/rendering/object.dart:1746:9) E/flutter (10176): #8 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13) E/flutter (10176): #9 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7) E/flutter (10176): #10 MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:171:11) E/flutter (10176): #11 _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:484:7) E/flutter (10176): #12 MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:240:7) E/flutter (10176): #13 RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:399:14) E/flutter (10176): #14 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7) E/flutter (10176): #15 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13) E/flutter (10176): #16 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7) E/flutter (10176): #17 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13) E/flutter (10176): #18 _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1248:11) E/flutter (10176): #19 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7) E/flutter (10176): #20 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13) E/flutter (10176): #21 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7) E/flutter (10176): #22 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13) E/flutter (10176): #23 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7) E/flutter (10176): #24 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13) E/flutter (10176): #25 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7) E/flutter (10176): #26 RenderStack.performLayout (package:flutter/src/rendering/stack.dart:556:15) E/flutter (10176): #27 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7) E/flutter (10176): #28 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13) E/flutter (10176): #29 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7) E/flutter (10176): #30 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13) E/flutter (10176): #31 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7) E/flutter (10176): #32 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13) E/flutter (10176): #33 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7) E/flutter (10176): #34 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13) E/flutter (10176): #35 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7) E/flutter (10176): #36 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13) E/flutter (10176): #37 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7) E/flutter (10176): #38 RenderOffstage.performLayout (package:flutter/src/rendering/proxy_box.dart:3223:14) E/flutter (10176): #39 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7) E/flutter (10176): #40 _RenderTheatre.performLayout (package:flutter/src/widgets/overlay.dart:700:15) E/flutter (10176): #41 RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1630:7) E/flutter (10176): #42 Pipeline

@pichillilorenzo
Copy link
Owner

Unfortunately, I cannot reproduce this error.

Have you tried to clean your project?
Also, try to upgrade your Flutter version.

Then, let me know! Thanks

@RomanKapshuk
Copy link
Author

RomanKapshuk commented May 22, 2020

Yes, I've tried
flutter clean
flutter pub cache repair
but nothing helped.
iOS works fine with version > 3.0
But I'm facing with a crash on Android devices

@pichillilorenzo
Copy link
Owner

I just tested on Android 9 (real device) and Android 10 (simulator) and it works fine!
I just used the basic code example from the README.md:

import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';

Future main() async {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(new MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {

  InAppWebViewController webView;
  String url = "";
  double progress = 0;

  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('InAppWebView Example'),
        ),
        body: Container(
            child: Column(children: <Widget>[
              Container(
                padding: EdgeInsets.all(20.0),
                child: Text(
                    "CURRENT URL\n${(url.length > 50) ? url.substring(0, 50) + "..." : url}"),
              ),
              Container(
                  padding: EdgeInsets.all(10.0),
                  child: progress < 1.0
                      ? LinearProgressIndicator(value: progress)
                      : Container()),
              Expanded(
                child: Container(
                  margin: const EdgeInsets.all(10.0),
                  decoration:
                  BoxDecoration(border: Border.all(color: Colors.blueAccent)),
                  child: InAppWebView(
                    initialUrl: "https://flutter.dev/",
                    initialHeaders: {},
                    initialOptions: InAppWebViewGroupOptions(
                        crossPlatform: InAppWebViewOptions(
                          debuggingEnabled: true,
                        )
                    ),
                    onWebViewCreated: (InAppWebViewController controller) {
                      webView = controller;
                    },
                    onLoadStart: (InAppWebViewController controller, String url) {
                      setState(() {
                        this.url = url;
                      });
                    },
                    onLoadStop: (InAppWebViewController controller, String url) async {
                      setState(() {
                        this.url = url;
                      });
                    },
                    onProgressChanged: (InAppWebViewController controller, int progress) {
                      setState(() {
                        this.progress = progress / 100;
                      });
                    },
                  ),
                ),
              ),
              ButtonBar(
                alignment: MainAxisAlignment.center,
                children: <Widget>[
                  RaisedButton(
                    child: Icon(Icons.arrow_back),
                    onPressed: () {
                      if (webView != null) {
                        webView.goBack();
                      }
                    },
                  ),
                  RaisedButton(
                    child: Icon(Icons.arrow_forward),
                    onPressed: () {
                      if (webView != null) {
                        webView.goForward();
                      }
                    },
                  ),
                  RaisedButton(
                    child: Icon(Icons.refresh),
                    onPressed: () {
                      if (webView != null) {
                        webView.reload();
                      }
                    },
                  ),
                ],
              ),
            ])),
      ),
    );
  }
}

If you try my basic example, does it work for you?

@pichillilorenzo
Copy link
Owner

Also, try to run flutter upgrade to update your Flutter version.

@RomanKapshuk
Copy link
Author

No, it does not work. Same crash. Here is my output of flutter doctor -v

[✓]  Flutter (Channel stable, v1.17.1, on Mac OS X 10.15.4 19E266, locale en-UA)
    • Flutter version 1.17.1 at /Users/r.kapshuk/development/flutter
    • Framework revision f7a6a7906b (9 days ago), 2020-05-12 18:39:00 -0700
    • Engine revision 6bc433c6b6
    • Dart version 2.8.2

 [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0-rc2)
    • Android SDK at /Users/r.kapshuk/Library/Android/sdk
    • Platform android-R, build-tools 29.0.0-rc2
    • ANDROID_HOME = /Users/r.kapshuk/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.4.1, Build version 11E503a
    • CocoaPods version 1.9.1

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.8052
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] Connected device (1 available)
    • AOSP on IA Emulator • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

@pichillilorenzo
Copy link
Owner

@RomanKapshuk Mmm ok. So, let's try this:

Use flutter_inappwebview from the git master branch, so change your pubspec.yaml dependency for my plugin with:

flutter_inappwebview:
    git:
      url: https://github.com/pichillilorenzo/flutter_inappwebview.git
      ref: master

Then, launch my code example again and post here the FULL logs (from start to the end) that you are receiving in Android Studio Logcat section (not Run section):
Schermata 2020-05-22 alle 16 56 41

@Phearun99, if you want, you can also help us to test it!

Thanks!

@pichillilorenzo
Copy link
Owner

pichillilorenzo commented May 22, 2020

@RomanKapshuk Also, can you post here your android/app/src/main/AndroidManifest.xml? Thanks

@RomanKapshuk
Copy link
Author

RomanKapshuk commented May 22, 2020

Manifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="package">

    <uses-permission
        android:name="android.permission.RECORD_AUDIO"
        tools:node="remove" />

    <application
        android:name=".Application"
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:label="label"
        android:roundIcon="@mipmap/ic_launcher_round">
        <activity
            android:name=".MainActivity"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:launchMode="singleTask"
            android:theme="@style/LaunchTheme"
            android:windowSoftInputMode="adjustResize">
  
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

            <intent-filter>
                <action android:name="FLUTTER_NOTIFICATION_CLICK" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>

            <meta-data
                android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
                android:value="true" />
        </activity>

        <activity
            android:name="com.facebook.FacebookActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:label="@string/app_name"
            android:theme="@style/LaunchTheme"
            tools:replace="android:theme" />

        <activity
            android:name="com.facebook.CustomTabActivity"
            android:exported="true"
            android:theme="@style/LaunchTheme"
            tools:replace="android:theme">

            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:scheme="@string/scheme" />
            </intent-filter>
        </activity>
        <receiver
            android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver"
            android:enabled="true"
            android:permission="android.permission.INSTALL_PACKAGES">
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER" />
            </intent-filter>
        </receiver>
        <service
            android:name="com.google.android.gms.measurement.AppMeasurementService"
            android:enabled="true"
            android:exported="false" />

    </application>
    <uses-permission android:name="android.permission.INTERNET" />
</manifest>

Log:

2020-05-22 19:06:03.540 1638-1696/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 143482766 , only wrote 143116560
2020-05-22 19:06:03.608 1877-1877/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2020-05-22 19:06:03.608 1877-1877/? E/netmgr: WifiForwarder unable to open QEMU pipe: Invalid argument
2020-05-22 19:06:04.411 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@130779c)
2020-05-22 19:06:04.413 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@130779c)
2020-05-22 19:06:05.416 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@4bca5a5)
2020-05-22 19:06:05.418 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@4bca5a5)
2020-05-22 19:06:06.421 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@168fd7a)
2020-05-22 19:06:06.422 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@168fd7a)
2020-05-22 19:06:06.761 1638-8101/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 143116836 , only wrote 143116560
2020-05-22 19:06:06.808 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:06.829 1929-1939/? I/DisplayManagerService: Display device added: DisplayDeviceInfo{"flutter-vd": uniqueId=",10086,flutter-vd,0", 1080 x 1868, modeId 7, defaultModeId 7, supportedModes [{id=7, width=1080, height=1868, fps=60.0}], colorMode 0, supportedColorModes [0], HdrCapabilities null, density 440, 440.0 x 440.0 dpi, appVsyncOff 0, presDeadline 16666666, touch NONE, rotation 0, type VIRTUAL, state ON, owner  FLAG_PRIVATE, FLAG_NEVER_BLANK, FLAG_OWN_CONTENT_ONLY}
2020-05-22 19:06:06.824 1638-8101/? I/chatty: uid=1041(audioserver) writer identical 1 line
2020-05-22 19:06:06.839 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:06.845 1771-1771/? D/SurfaceFlinger: duplicate layer name: changing Display Root to Display Root#1
2020-05-22 19:06:06.846 1771-1771/? D/SurfaceFlinger: duplicate layer name: changing Display Overlays to Display Overlays#1
2020-05-22 19:06:06.850 1771-1771/? D/SurfaceFlinger: duplicate layer name: changing mBelowAppWindowsContainers to mBelowAppWindowsContainers#1
2020-05-22 19:06:06.852 24090-24090/appPackage D/FlutterWebView:  Shared.activity is null
2020-05-22 19:06:06.854 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:06.858 1771-1771/? D/SurfaceFlinger: duplicate layer name: changing animationLayer to animationLayer#1
2020-05-22 19:06:06.860 1771-1771/? D/SurfaceFlinger: duplicate layer name: changing boostedAnimationLayer to boostedAnimationLayer#1
2020-05-22 19:06:06.861 1771-1771/? D/SurfaceFlinger: duplicate layer name: changing homeAnimationLayer to homeAnimationLayer#1
2020-05-22 19:06:06.864 1771-1771/? D/SurfaceFlinger: duplicate layer name: changing splitScreenDividerAnchor to splitScreenDividerAnchor#1
2020-05-22 19:06:06.865 1771-1771/? D/SurfaceFlinger: duplicate layer name: changing mAboveAppWindowsContainers to mAboveAppWindowsContainers#1
2020-05-22 19:06:06.867 1771-1771/? D/SurfaceFlinger: duplicate layer name: changing mImeWindowsContainers to mImeWindowsContainers#1
2020-05-22 19:06:06.869 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:06.877 24090-24090/appPackage E/MethodChannel#flutter/platform_views: Failed to handle method call
    java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
        at android.view.ViewConfiguration.get(ViewConfiguration.java:447)
        at android.view.View.<init>(View.java:4806)
        at android.view.View.<init>(View.java:4948)
        at android.view.ViewGroup.<init>(ViewGroup.java:659)
        at android.widget.AbsoluteLayout.<init>(AbsoluteLayout.java:55)
        at android.webkit.WebView.<init>(WebView.java:659)
        at android.webkit.WebView.<init>(WebView.java:604)
        at android.webkit.WebView.<init>(WebView.java:587)
        at android.webkit.WebView.<init>(WebView.java:574)
        at android.webkit.WebView.<init>(WebView.java:564)
        at com.pichillilorenzo.flutter_inappwebview.InAppWebView.InputAwareWebView.<init>(InputAwareWebView.java:28)
        at com.pichillilorenzo.flutter_inappwebview.InAppWebView.InAppWebView.<init>(InAppWebView.java:608)
        at com.pichillilorenzo.flutter_inappwebview.InAppWebView.FlutterWebView.<init>(FlutterWebView.java:59)
        at com.pichillilorenzo.flutter_inappwebview.InAppWebView.FlutterWebViewFactory.create(FlutterWebViewFactory.java:28)
        at io.flutter.plugin.platform.SingleViewPresentation.onCreate(SingleViewPresentation.java:179)
        at android.app.Dialog.dispatchOnCreate(Dialog.java:407)
        at android.app.Dialog.show(Dialog.java:302)
        at android.app.Presentation.show(Presentation.java:249)
        at io.flutter.plugin.platform.VirtualDisplayController.<init>(VirtualDisplayController.java:94)
        at io.flutter.plugin.platform.VirtualDisplayController.create(VirtualDisplayController.java:47)
        at io.flutter.plugin.platform.PlatformViewsController$1.createPlatformView(PlatformViewsController.java:112)
        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:95)
        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226)
        at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
        at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:326)
        at android.os.Looper.loop(Looper.java:160)
        at android.app.ActivityThread.main(ActivityThread.java:6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
2020-05-22 19:06:06.880 24090-24305/appPackage E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference, null)
    #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
    #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18)
    <asynchronous suspension>
    #2      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
    #3      AndroidViewController._create (package:flutter/src/services/platform_views.dart:633:54)
    #4      AndroidViewController.setSize (package:flutter/src/services/platform_views.dart:550:14)
    #5      RenderAndroidView._sizePlatformView (package:flutter/src/rendering/platform_view.dart:175:29)
    #6      RenderAndroidView.performResize (package:flutter/src/rendering/platform_view.dart:156:5)
    #7      RenderObject.layout (package:flutter/src/rendering/object.dart:1746:9)
    #8      RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
    #9      RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
    #10     MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:171:11)
    #11     _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:484:7)
    #12     MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:240:7)
    #13     RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:399:14)
    #14     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
    #15     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
    #16     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
    #17     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
    #18     _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1248:11)
    #19     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
    #20     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
    #21     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
    #22     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
    #23     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
    #24     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
    #25     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
    #26     RenderStack.performLayout (package:flutter/src/rendering/stack.dart:556:15)
    #27     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
    #28     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
    #29     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
    #30     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
    #31     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
    #32     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
    #33     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
    #34     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
    #35     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
    #36     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
    #37     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
    #38     RenderOffstage.performLayout (package:flutter/src/rendering/proxy_box.dart:3223:14)
    #39     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
    #40     _RenderTheatre.performLayout (package:flutter/src/widgets/overlay.dart:700:15)
    #41     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1630:7)
    #42     Pipeline
2020-05-22 19:06:06.884 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:06.893 1929-1952/? I/ActivityManager: Override config changes=20005df8 {0.0 ?mcc?mnc ?localeList ?layoutDir sw392dp w392dp h679dp 440dpi nrml long port ?uimode ?night finger qwerty/v/v -nav/h winConfig={ mBounds=Rect(0, 0 - 1080, 1868) mAppBounds=Rect(0, 0 - 1080, 1868) mWindowingMode=fullscreen mActivityType=undefined}} for displayId=6
2020-05-22 19:06:06.896 1929-1952/? W/LocalDisplayAdapter: Unable to find color mode 0, ignoring request.
2020-05-22 19:06:06.897 1929-1952/? I/WindowManager: Screen frozen for +26ms due to new-config
2020-05-22 19:06:06.899 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:06.907 1929-1999/? I/InputReader: Reconfiguring input devices.  changes=0x00000004
2020-05-22 19:06:06.912 1771-1771/? E/HWComposer: getHdrCapabilities failed for display -1: Invalid display
2020-05-22 19:06:06.914 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:06.920 1648-2351/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 8073216
2020-05-22 19:06:06.929 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:06.940 1771-1771/? E/HWComposer: getSupportedPerFrameMetadata failed for display -1: Invalid display
2020-05-22 19:06:06.944 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:06.948 1771-1771/? D/EGL_emulation: eglMakeCurrent: 0xea9a0ae0: ver 3 0 (tinfo 0xea99c300)
2020-05-22 19:06:06.951 1648-2351/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 8073216
2020-05-22 19:06:06.959 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:06.970 1771-1771/? D/EGL_emulation: eglMakeCurrent: 0xea9a0ae0: ver 3 0 (tinfo 0xea99c300)
2020-05-22 19:06:06.971 1771-1771/? D/EGL_emulation: eglMakeCurrent: 0xea9a0ae0: ver 3 0 (tinfo 0xea99c300)
2020-05-22 19:06:06.974 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:06.974 1771-1771/? D/EGL_emulation: eglMakeCurrent: 0xea9a0ae0: ver 3 0 (tinfo 0xea99c300)
2020-05-22 19:06:06.980 1771-1771/? D/EGL_emulation: eglMakeCurrent: 0xea9a0ae0: ver 3 0 (tinfo 0xea99c300)
2020-05-22 19:06:06.989 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:07.004 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:07.010 1771-1771/? D/EGL_emulation: eglMakeCurrent: 0xea9a0ae0: ver 3 0 (tinfo 0xea99c300)
2020-05-22 19:06:07.019 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:07.023 1771-1771/? D/EGL_emulation: eglMakeCurrent: 0xea9a0ae0: ver 3 0 (tinfo 0xea99c300)
2020-05-22 19:06:07.026 1771-1771/? I/chatty: uid=1000(system) /system/bin/surfaceflinger identical 1 line
2020-05-22 19:06:07.032 1771-1771/? D/EGL_emulation: eglMakeCurrent: 0xea9a0ae0: ver 3 0 (tinfo 0xea99c300)
2020-05-22 19:06:07.034 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:07.049 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:07.057 1771-1771/? D/EGL_emulation: eglMakeCurrent: 0xea9a0ae0: ver 3 0 (tinfo 0xea99c300)
2020-05-22 19:06:07.062 1771-1771/? D/EGL_emulation: eglMakeCurrent: 0xea9a0ae0: ver 3 0 (tinfo 0xea99c300)
2020-05-22 19:06:07.063 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:07.076 1771-1771/? D/EGL_emulation: eglMakeCurrent: 0xea9a0ae0: ver 3 0 (tinfo 0xea99c300)
2020-05-22 19:06:07.080 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:07.085 1771-1771/? D/EGL_emulation: eglMakeCurrent: 0xea9a0ae0: ver 3 0 (tinfo 0xea99c300)
2020-05-22 19:06:07.092 1771-1771/? D/EGL_emulation: eglMakeCurrent: 0xea9a0ae0: ver 3 0 (tinfo 0xea99c300)
2020-05-22 19:06:07.094 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:07.098 1771-1771/? D/EGL_emulation: eglMakeCurrent: 0xea9a0ae0: ver 3 0 (tinfo 0xea99c300)
2020-05-22 19:06:07.109 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:07.113 1771-1771/? D/EGL_emulation: eglMakeCurrent: 0xea9a0ae0: ver 3 0 (tinfo 0xea99c300)
2020-05-22 19:06:07.118 1771-1771/? D/EGL_emulation: eglMakeCurrent: 0xea9a0ae0: ver 3 0 (tinfo 0xea99c300)
2020-05-22 19:06:07.123 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:07.394 1638-8101/? I/chatty: uid=1041(audioserver) writer identical 18 lines
2020-05-22 19:06:07.409 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:07.423 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@4f6f721)
2020-05-22 19:06:07.425 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:07.425 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@4f6f721)
2020-05-22 19:06:07.440 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:08.400 1638-8101/? I/chatty: uid=1041(audioserver) writer identical 64 lines
2020-05-22 19:06:08.415 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:08.427 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@f97746)
2020-05-22 19:06:08.428 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@f97746)
2020-05-22 19:06:08.429 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:08.984 1638-8101/? I/chatty: uid=1041(audioserver) writer identical 37 lines
2020-05-22 19:06:08.999 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:09.004 1929-1952/? I/system_server: Explicit concurrent copying GC freed 76058(3MB) AllocSpace objects, 23(1156KB) LOS objects, 32% free, 12MB/18MB, paused 567us total 102.845ms
2020-05-22 19:06:09.014 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:09.404 1638-8101/? I/chatty: uid=1041(audioserver) writer identical 26 lines
2020-05-22 19:06:09.420 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:09.432 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@2b34d07)
2020-05-22 19:06:09.434 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@2b34d07)
2020-05-22 19:06:09.434 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:09.914 1638-8101/? I/chatty: uid=1041(audioserver) writer identical 32 lines
2020-05-22 19:06:09.929 1638-8101/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
2020-05-22 19:06:09.972 1638-1696/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 143423012 , only wrote 143270640
2020-05-22 19:06:10.436 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@23a1e34)
2020-05-22 19:06:10.437 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@23a1e34)
2020-05-22 19:06:11.441 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@82ae45d)
2020-05-22 19:06:11.442 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@82ae45d)
2020-05-22 19:06:12.444 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@8c5c1d2)
2020-05-22 19:06:12.446 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@8c5c1d2)
2020-05-22 19:06:13.449 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@7adb2a3)
2020-05-22 19:06:13.450 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@7adb2a3)
2020-05-22 19:06:14.453 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@e74e9a0)
2020-05-22 19:06:14.454 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@e74e9a0)
2020-05-22 19:06:15.458 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@8b66959)
2020-05-22 19:06:15.459 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@8b66959)
2020-05-22 19:06:16.463 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@d9a291e)
2020-05-22 19:06:16.465 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@d9a291e)
2020-05-22 19:06:16.754 1638-1707/? E/audio_hw_generic: pcm_write failed cannot write stream data: I/O error
2020-05-22 19:06:16.805 1929-1948/? E/BatteryExternalStatsWorker: no controller energy info supplied for wifi
2020-05-22 19:06:17.466 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@5ceffcc)
2020-05-22 19:06:17.466 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@5ceffcc)
2020-05-22 19:06:18.470 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@edb4215)
2020-05-22 19:06:18.472 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@edb4215)
2020-05-22 19:06:19.474 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@2bbb92a)
2020-05-22 19:06:19.475 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@2bbb92a)
2020-05-22 19:06:20.478 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@cd4d31b)
2020-05-22 19:06:20.480 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@cd4d31b)
2020-05-22 19:06:21.482 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@d24cb8)
2020-05-22 19:06:21.484 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@d24cb8)
2020-05-22 19:06:22.485 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@b3aea91)
2020-05-22 19:06:22.486 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@b3aea91)
2020-05-22 19:06:23.490 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@8b43df6)
2020-05-22 19:06:23.491 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@8b43df6)
2020-05-22 19:06:24.494 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@1e385f7)
2020-05-22 19:06:24.495 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@1e385f7)
2020-05-22 19:06:25.498 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@4bb7c64)
2020-05-22 19:06:25.501 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@4bb7c64)
2020-05-22 19:06:26.501 1929-20094/? I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@d129ecd)
2020-05-22 19:06:26.502 1929-1943/? I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@d129ecd)

@pichillilorenzo
Copy link
Owner

Ok I understand what is causing the problem!
However, I'm not seeing all the logs I was expected to see.
Please, before starting the code example, you need to select Android Studio Logcat section and then, only then, start the app example!

Make sure to copy ALL the logs and paste it here.
I need to know some other logs I was printing with Log.d on Android.

Thanks again!

@pichillilorenzo
Copy link
Owner

@RomanKapshuk However, it seems that ActivityAware.onAttachedToActivity event is not called by Flutter!!

Try to add this tag:

<meta-data
  android:name="flutterEmbedding"
  android:value="2" />

inside the <application> tag

<application
        android:name=".Application"
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:label="label"
        android:roundIcon="@mipmap/ic_launcher_round">

        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />

</application>

in your AndroidManifest.xml!

An example is:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.flutterapp">
    <!-- io.flutter.app.FlutterApplication is an android.app.Application that
         calls FlutterMain.startInitialization(this); in its onCreate method.
         In most cases you can leave this as-is, but you if you want to provide
         additional functionality it is fine to subclass or reimplement
         FlutterApplication and put your custom class here. -->
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="flutterapp"
        android:icon="@mipmap/ic_launcher">
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <!-- Displays an Android View that continues showing the launch screen
                 Drawable until Flutter paints its first frame, then this splash
                 screen fades out. A splash screen is useful to avoid any visual
                 gap between the end of Android's launch screen and the painting of
                 Flutter's first frame. -->
            <meta-data
              android:name="io.flutter.embedding.android.SplashScreenDrawable"
              android:resource="@drawable/launch_background"
              />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>

        <!-- HERE IS THE TAG: -->
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

Also, remember that you need to call WidgetsFlutterBinding.ensureInitialized() before running your App instance! A code example is:

Future main() async {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(new MyApp());
}

Let me know if it works now! Thanks.

@pichillilorenzo
Copy link
Owner

@RomanKapshuk @Phearun99 It seems that adding:

<meta-data
  android:name="flutterEmbedding"
  android:value="2" />

inside the AndroidManifest.xml, makes it work: #343 (comment)!

@RomanKapshuk
Copy link
Author

@pichillilorenzo Thanks. Looks like migration to flutterEmbedding v2 fixed the problem.

This was referenced Jul 6, 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 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants