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

Have Changed Android minSDK? Crash on Android API level19(WebView shows blank) #342

Closed
le-kamba opened this issue May 12, 2020 · 2 comments

Comments

@le-kamba
Copy link

le-kamba commented May 12, 2020

Environment

Flutter version:1.12.13+hotfix.9
Plugin version:3.0.0
Android version:19
Device information:SONY SOL33

You are recommending Android minSDK>=17 , but it seems to be >=20.

Android: minSdkVersion 17 and add support for androidx (see AndroidX Migration to migrate an existing app)

Description

Expected behavior:
Show website.

Current behavior:
Blank page shows.

Steps to reproduce

  1. Set InAppWebView as AlertDialog's content.
  2. Use initialOptions: InAppWebViewWidgetOptions(
    crossPlatform: InAppWebViewOptions())
  3. Internet connection is OK.
  4. Launch App and show Dialog.

Stacktrace/Logcat

E/flutter (28536): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, java.lang.IllegalStateException: Trying to use platform views with API 19, required API level is: 20
E/flutter (28536): 	at io.flutter.plugin.platform.PlatformViewsController$1.ensureValidAndroidVersion(PlatformViewsController.java:257)
E/flutter (28536): 	at io.flutter.plugin.platform.PlatformViewsController$1.createPlatformView(PlatformViewsController.java:77)
E/flutter (28536): 	at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:96)
E/flutter (28536): 	at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:60)
E/flutter (28536): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:231)
E/flutter (28536): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:93)
E/flutter (28536): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:642)
E/flutter (28536): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (28536): 	at android.os.MessageQueue.next(MessageQueue.java:138)
E/flutter (28536): 	at android.os.Looper.loop(Looper.java:196)
E/flutter (28536): 	at android.app.ActivityThread.main(ActivityThread.java:5151)
E/flutter (28536): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/flutter (28536): 	at java.lang.reflect.Method.invoke(Method.java:515)
E/flutter (28536): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877)
E/flutter (28536): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
E/flutter (28536): 	at dalvik.system.NativeStart.main(Native Method)
E/flutter (28536): , null)
E/flutter (28536): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter (28536): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
E/flutter (28536): <asynchronous suspension>
E/flutter (28536): #2      AndroidViewController._create (package:flutter/src/services/platform_views.dart:640:54)
E/flutter (28536): #3      AndroidViewController.setSize (package:flutter/src/services/platform_views.dart:557:14)
E/flutter (28536): #4      RenderAndroidView._sizePlatformView (package:flutter/src/rendering/platform_view.dart:174:29)
E/flutter (28536): #5      RenderAndroidView.performResize (package:flutter/src/rendering/platform_view.dart:155:5)
E/flutter (28536): #6      RenderObject.layout (package:flutter/src/rendering/object.dart:1703:9)
E/flutter (28536): #7      RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (28536): #8      RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #9      RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (28536): #10     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #11     RenderConstrainedBox.performLayout (package:flutter/src/rendering/proxy_box.dart:259:13)
E/flutter (28536): #12     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #13     RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:206:11)
E/flutter (28536): #14     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #15     RenderFlex.performLayout (package:flutter/src/rendering/flex.dart:806:17)
E/flutter (28536): #16     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #17     RenderIntrinsicWidth.performLayout (package:flutter/src/rendering/proxy_box.dart:642:13)
E/flutter (28536): #18     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #19     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (28536): #20     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #21     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (28536): #22     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #23     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (28536): #24     _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1232:11)
E/flutter (28536): #25     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #26     RenderConstrainedBox.performLayout (package:flutter/src/rendering/proxy_box.dart:259:13)
E/flutter (28536): #27     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #28     RenderPositionedBox.performLayout (package:flutter/src/rendering/shifted_box.
E/flutter (28536): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, java.lang.IllegalStateException: Trying to use platform views with API 19, required API level is: 20
E/flutter (28536): 	at io.flutter.plugin.platform.PlatformViewsController$1.ensureValidAndroidVersion(PlatformViewsController.java:257)
E/flutter (28536): 	at io.flutter.plugin.platform.PlatformViewsController$1.createPlatformView(PlatformViewsController.java:77)
E/flutter (28536): 	at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:96)
E/flutter (28536): 	at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:60)
E/flutter (28536): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:231)
E/flutter (28536): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:93)
E/flutter (28536): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:642)
E/flutter (28536): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (28536): 	at android.os.MessageQueue.next(MessageQueue.java:138)
E/flutter (28536): 	at android.os.Looper.loop(Looper.java:196)
E/flutter (28536): 	at android.app.ActivityThread.main(ActivityThread.java:5151)
E/flutter (28536): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/flutter (28536): 	at java.lang.reflect.Method.invoke(Method.java:515)
E/flutter (28536): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877)
E/flutter (28536): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
E/flutter (28536): 	at dalvik.system.NativeStart.main(Native Method)
E/flutter (28536): , null)
E/flutter (28536): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter (28536): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
E/flutter (28536): <asynchronous suspension>
E/flutter (28536): #2      AndroidViewController._create (package:flutter/src/services/platform_views.dart:640:54)
E/flutter (28536): #3      AndroidViewController.setSize (package:flutter/src/services/platform_views.dart:557:14)
E/flutter (28536): #4      RenderAndroidView._sizePlatformView (package:flutter/src/rendering/platform_view.dart:174:29)
E/flutter (28536): #5      RenderAndroidView.performResize (package:flutter/src/rendering/platform_view.dart:155:5)
E/flutter (28536): #6      RenderObject.layout (package:flutter/src/rendering/object.dart:1703:9)
E/flutter (28536): #7      RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (28536): #8      RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #9      RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (28536): #10     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #11     RenderConstrainedBox.performLayout (package:flutter/src/rendering/proxy_box.dart:259:13)
E/flutter (28536): #12     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #13     RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:206:11)
E/flutter (28536): #14     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #15     RenderFlex.performLayout (package:flutter/src/rendering/flex.dart:806:17)
E/flutter (28536): #16     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #17     RenderIntrinsicWidth.performLayout (package:flutter/src/rendering/proxy_box.dart:642:13)
E/flutter (28536): #18     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #19     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (28536): #20     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #21     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (28536): #22     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #23     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (28536): #24     _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1232:11)
E/flutter (28536): #25     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #26     RenderConstrainedBox.performLayout (package:flutter/src/rendering/proxy_box.dart:259:13)
E/flutter (28536): #27     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (28536): #28     RenderPositionedBox.performLayout (package:flutter/src/rendering/shifted_box.
@pichillilorenzo
Copy link
Owner

It seems that AndroidView requires Android API level 20 or greater at the moment (see also flutter/flutter#23728).
I need to update the README.md file about this for the InAppWebView widget.

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