Google Maps and Android 5.1 (API 22)

Troubleshooting

Hello FlutterFlow Community

I am developing an application with Google Maps.

In Android versions 5.1 (API 23) or higher the application works normally (Screenshot_Android_API_35_Polygon).

In versions below API 23 the map is not displayed (Screenshot_Android_5.1_API_22).

Looking at the device log, the message "Platform views cannot be displayed below API level 23You can prevent this issue by setting minSdkVersion: 23 in build.gradle., null, java.lang.UnsupportedOperationException: Platform views cannot be displayed below API level 23 You can prevent this issue by setting minSdkVersion: 23 in build.gradle." caught my attention.

I would like to know if the Google Maps widget cannot be executed in APIs below level 23.

Device Log (API 22)

Launching lib\main.dart on Android SDK built for x86 in debug mode...

Upgrading build.gradle

Running Gradle task 'assembleDebug'... 48,9s

√ Built build\app\outputs\flutter-apk\app-debug.apk

Installing build\app\outputs\flutter-apk\app-debug.apk... 15,3s

D/FlutterGeolocator( 6054): Attaching Geolocator to activity

D/FlutterGeolocator( 6054): Creating service.

D/FlutterGeolocator( 6054): Binding to location service.

D/FlutterGeolocator( 6054): Geolocator foreground service connected

D/FlutterGeolocator( 6054): Initializing Geolocator services

D/FlutterGeolocator( 6054): Flutter engine connected. Connected engine count 1

Syncing files to device Android SDK built for x86... 632ms

Flutter run key commands.

r Hot reload.

R Hot restart.

h List all available interactive commands.

d Detach (terminate "flutter run" but leave application running).

c Clear the screen

q Quit (terminate the application on the device).

A Dart VM Service on Android SDK built for x86 is available at: http://127.0.0.1:56579/5IQmi3QD6Dw=/

I/art ( 6054): Rejecting re-init on previously-failed class java.lang.Class<com.baseflow.geolocator.location.NmeaClient$$ExternalSyntheticLambda0>

I/art ( 6054): Rejecting re-init on previously-failed class java.lang.Class<com.baseflow.geolocator.location.NmeaClient$$ExternalSyntheticLambda0>

The Flutter DevTools debugger and profiler on Android SDK built for x86 is available at: http://127.0.0.1:9100?uri=http://127.0.0.1:56579/5IQmi3QD6Dw=/

I/flutter ( 6054): App is in foreground

I/flutter ( 6054): App is in foreground

D/InputConnectionAdaptor( 6054): The input method toggled cursor monitoring on

D/InputConnectionAdaptor( 6054): The input method toggled cursor monitoring on

D/MapsInitializer( 6054): preferredRenderer: null

D/zzcc ( 6054): preferredRenderer: null

I/zzcc ( 6054): Making Creator dynamically

I/art ( 6054): Background sticky concurrent mark sweep GC freed 28934(1604KB) AllocSpace objects, 1(16KB) LOS objects, 26% free, 4MB/6MB, paused 7.570ms total 26.002ms

W/DynamiteModule( 6054): Local module descriptor class for com.google.android.gms.maps_core_dynamite not found.

I/DynamiteModule( 6054): Considering local module com.google.android.gms.maps_core_dynamite:0 and remote module com.google.android.gms.maps_core_dynamite:0

D/zzcc ( 6054): Attempting to load maps_dynamite again.

I/DynamiteModule( 6054): Considering local module com.google.android.gms.maps_dynamite:0 and remote module com.google.android.gms.maps_dynamite:202414000

I/DynamiteModule( 6054): Selected remote version of com.google.android.gms.maps_dynamite, version >= 202414000

V/DynamiteModule( 6054): Dynamite loader version >= 2, using loadModule2NoCrashUtils

W/ResourcesManager( 6054): Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.

W/ResourcesManager( 6054): Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources.

I/Google Maps Android API( 6054): Google Play services client version: 18020000

D/MapsInitializer( 6054): loadedRenderer: LEGACY

D/zzcc ( 6054): preferredRenderer: null

I/Google Maps Android API( 6054): Google Play services package version: 202414013

I/art ( 6054): Background sticky concurrent mark sweep GC freed 285(104KB) AllocSpace objects, 0(0B) LOS objects, 2% free, 5MB/6MB, paused 6.448ms total 22.986ms

I/art ( 6054): Background sticky concurrent mark sweep GC freed 484(70KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 6MB/6MB, paused 6.893ms total 26.021ms

I/PlatformViewsController( 6054): Hosting view in a virtual display for platform view: 0

I/PlatformViewsController( 6054): PlatformView is using SurfaceTexture backend

E/MethodChannel#flutter/platform_views( 6054): Failed to handle method call

E/MethodChannel#flutter/platform_views( 6054): java.lang.UnsupportedOperationException: Platform views cannot be displayed below API level 23You can prevent this issue by setting minSdkVersion: 23 in build.gradle.

E/MethodChannel#flutter/platform_views( 6054): at io.flutter.plugin.platform.SurfaceTexturePlatformViewRenderTarget.<init>(SurfaceTexturePlatformViewRenderTarget.java:62)

E/MethodChannel#flutter/platform_views( 6054): at io.flutter.plugin.platform.PlatformViewsController.makePlatformViewRenderTarget(PlatformViewsController.java:1000)

E/MethodChannel#flutter/platform_views( 6054): at io.flutter.plugin.platform.PlatformViewsController.configureForVirtualDisplay(PlatformViewsController.java:557)

E/MethodChannel#flutter/platform_views( 6054): at io.flutter.plugin.platform.PlatformViewsController.access$800(PlatformViewsController.java:51)

E/MethodChannel#flutter/platform_views( 6054): at io.flutter.plugin.platform.PlatformViewsController$1.createForTextureLayer(PlatformViewsController.java:226)

E/MethodChannel#flutter/platform_views( 6054): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:128)

E/MethodChannel#flutter/platform_views( 6054): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:55)

E/MethodChannel#flutter/platform_views( 6054): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)

E/MethodChannel#flutter/platform_views( 6054): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292)

E/MethodChannel#flutter/platform_views( 6054): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)

E/MethodChannel#flutter/platform_views( 6054): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(D8$$SyntheticClass)

E/MethodChannel#flutter/platform_views( 6054): at android.os.Handler.handleCallback(Handler.java:739)

E/MethodChannel#flutter/platform_views( 6054): at android.os.Handler.dispatchMessage(Handler.java:95)

E/MethodChannel#flutter/platform_views( 6054): at android.os.Looper.loop(Looper.java:135)

E/MethodChannel#flutter/platform_views( 6054): at android.app.ActivityThread.main(ActivityThread.java:5254)

E/MethodChannel#flutter/platform_views( 6054): at java.lang.reflect.Method.invoke(Native Method)

E/MethodChannel#flutter/platform_views( 6054): at java.lang.reflect.Method.invoke(Method.java:372)

E/MethodChannel#flutter/platform_views( 6054): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)

E/MethodChannel#flutter/platform_views( 6054): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

E/flutter ( 6054): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, Platform views cannot be displayed below API level 23You can prevent this issue by setting minSdkVersion: 23 in build.gradle., null, java.lang.UnsupportedOperationException: Platform views cannot be displayed below API level 23You can prevent this issue by setting minSdkVersion: 23 in build.gradle.

E/flutter ( 6054): at io.flutter.plugin.platform.SurfaceTexturePlatformViewRenderTarget.<init>(SurfaceTexturePlatformViewRenderTarget.java:62)

E/flutter ( 6054): at io.flutter.plugin.platform.PlatformViewsController.makePlatformViewRenderTarget(PlatformViewsController.java:1000)

E/flutter ( 6054): at io.flutter.plugin.platform.PlatformViewsController.configureForVirtualDisplay(PlatformViewsController.java:557)

E/flutter ( 6054): at io.flutter.plugin.platform.PlatformViewsController.access$800(PlatformViewsController.java:51)

E/flutter ( 6054): at io.flutter.plugin.platform.PlatformViewsController$1.createForTextureLayer(PlatformViewsController.java:226)

E/flutter ( 6054): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:128)

E/flutter ( 6054): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:55)

E/flutter ( 6054): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)

E/flutter ( 6054): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292)

E/flutter ( 6054): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)

E/flutter ( 6054): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(D8$$SyntheticClass)

E/flutter ( 6054): at android.os.Handler.handleCallback(Handler.java:739)

E/flutter ( 6054): at android.os.Handler.dispatchMessage(Handler.java:95)

E/flutter ( 6054): at android.os.Looper.loop(Looper.java:135)

E/flutter ( 6054): at android.app.ActivityThread.main(ActivityThread.java:5254)

E/flutter ( 6054): at java.lang.reflect.Method.invoke(Native Method)

E/flutter ( 6054): at java.lang.reflect.Method.invoke(Method.java:372)

E/flutter ( 6054): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)

E/flutter ( 6054): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

E/flutter ( 6054): )

E/flutter ( 6054): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:648:7)

E/flutter ( 6054): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334:18)

E/flutter ( 6054): <asynchronous suspension>

E/flutter ( 6054): #2 TextureAndroidViewController._sendCreateMessage (package:flutter/src/services/platform_views.dart:1164:28)

E/flutter ( 6054): <asynchronous suspension>

E/flutter ( 6054): #3 AndroidViewController.create (package:flutter/src/services/platform_views.dart:827:5)

E/flutter ( 6054): <asynchronous suspension>

E/flutter ( 6054): #4 AndroidViewController.setSize (package:flutter/src/services/platform_views.dart:854:7)

E/flutter ( 6054): <asynchronous suspension>

E/flutter ( 6054): #5 RenderAndroidView._sizePlatformView (package:flutter/src/rendering/platform_view.dart:176:29)

E/flutter ( 6054): <asynchronous suspension>

E/flutter ( 6054):

I/GoogleMapController( 6054): No TextureView found. Likely using the LEGACY renderer.

E/flutter ( 6054): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: FormatException: Invalid number (at character 1)

E/flutter ( 6054):

E/flutter ( 6054): ^

E/flutter ( 6054):

E/flutter ( 6054): #0 int._handleFormatError (dart:core-patch/integers_patch.dart:125:7)

E/flutter ( 6054): #1 int.parse (dart:core-patch/integers_patch.dart:51:14)

E/flutter ( 6054): #2 MapaPontoWidgetState.initState.<anonymous closure> (package:projetoteste_lbl/pages/mapa_ponto/mapa_ponto_widget.dart:65:15)

E/flutter ( 6054): <asynchronous suspension>

E/flutter ( 6054):

W/DynamiteModule( 6054): Local module descriptor class for com.google.android.gms.googlecertificates not found.

I/DynamiteModule( 6054): Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:4

I/DynamiteModule( 6054): Selected remote version of com.google.android.gms.googlecertificates, version >= 4

I/TRuntime.CctTransportBa( 6054): Making request to: https://firebaselogging-pa.googleapis.com/v1/firelog/legacy/batchlog

I/TRuntime.CctTransportBa( 6054): Status Code: 200

Can you help?

Thanks

What have you tried so far?

- Update Google Maps app on Android 5.1 device

- Update Google Play Services

- Force use of LEGACY render with custom functions

- Force use of LATEST render with custom function

Did you check FlutterFlow's Documentation for this topic?
Yes
1
1 reply