Useful or not, from you.
flutter [google_maps_flutter] Trying to create an already created platform view

Hi,

When using the google_maps_flutter plugin I'm encountering some weirdness.

When running the app in debug first time everything is fine, but attempts to load the map after a rebuild (just hitting Play on AndroidStudio) the following error is being thrown and the map is blacked out:

E/flutter (23023): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, java.lang.IllegalStateException: Trying to create an already created platform view, view id: 0
E/flutter (23023): 	at io.flutter.plugin.platform.PlatformViewsController$1.createPlatformView(PlatformViewsController.java:85)
E/flutter (23023): 	at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:96)
E/flutter (23023): 	at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:60)
E/flutter (23023): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:231)
E/flutter (23023): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:93)
E/flutter (23023): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:642)
E/flutter (23023): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (23023): 	at android.os.MessageQueue.next(MessageQueue.java:326)
E/flutter (23023): 	at android.os.Looper.loop(Looper.java:160)
E/flutter (23023): 	at android.app.ActivityThread.main(ActivityThread.java:6718)
E/flutter (23023): 	at java.lang.reflect.Method.invoke(Native Method)
E/flutter (23023): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/flutter (23023): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
E/flutter (23023): , null)
E/flutter (23023): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter (23023): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
E/flutter (23023): <asynchronous suspension>
E/flutter (23023): #2      AndroidViewController._create (package:flutter/src/services/platform_views.dart:640:54)
E/flutter (23023): #3      AndroidViewController.setSize (package:flutter/src/services/platform_views.dart:557:14)
E/flutter (23023): #4      RenderAndroidView._sizePlatformView (package:flutter/src/rendering/platform_view.dart:174:29)
E/flutter (23023): #5      RenderAndroidView.performResize (package:flutter/src/rendering/platform_view.dart:155:5)
E/flutter (23023): #6      RenderObject.layout (package:flutter/src/rendering/object.dart:1703:9)
E/flutter (23023): #7      RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (23023): #8      RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (23023): #9      RenderStack.performLayout (package:flutter/src/rendering/stack.dart:505:15)
E/flutter (23023): #10     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (23023): #11     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (23023): #12     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (23023): #13     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (23023): #14     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (23023): #15     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (23023): #16     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (23023): #17     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (23023): #18     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (23023): #19     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (23023): #20     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (23023): #21     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (23023): #22     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (23023): #23     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (23023): #24     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (23023): #25     RenderOffstage.performLayout (package:flutter/src/rendering/proxy_box.dart:3166:14)
E/flutter (23023): #26     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (23023): #27     RenderStack.performLayout (package:flutter/src/rendering/stack.dart:505:15)
E/flutter (23023): #28     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1584:7)
E/flutter (23023): #29     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:844:18)
E/flutter (23023): #30     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:344:19)
E/flutter (23023): #31     WidgetsBinding.drawFrame (package:flutter/src/w

If I hit the Stop button then rebuild it after a few moments the error is displayed again but the app loads and works just fine. It seems weird that an error is occurring during runtime then reoccurring during a build. Any advice on this? Sorry that I'm not more technically versed with this sort of thing.

That's a useful answer
Without any help

I have the same issue