App运行时Google Flutter Google Map API问题

萨汉(Sahan Dissanayaka)

我目前正在开发用于跟踪患者的应用程序。所以我使用谷歌地图,我已经从谷歌云平台获取了API密钥,并限制了该密钥,就像Android Map SDK一样

然后我更改了android manifest.xml和ios Runners和plist

当我运行应用程序时,它显示以下错误

E/flutter ( 4675): [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 ( 4675):  at io.flutter.plugin.platform.PlatformViewsController$1.createPlatformView(PlatformViewsController.java:85)
E/flutter ( 4675):  at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:96)
E/flutter ( 4675):  at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:60)
E/flutter ( 4675):  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:231)
E/flutter ( 4675):  at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:93)
E/flutter ( 4675):  at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:642)
E/flutter ( 4675):  at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter ( 4675):  at android.os.MessageQueue.next(MessageQueue.java:326)
E/flutter ( 4675):  at android.os.Looper.loop(Looper.java:160)
E/flutter ( 4675):  at android.app.ActivityThread.main(ActivityThread.java:6669)
E/flutter ( 4675):  at java.lang.reflect.Method.invoke(Native Method)
E/flutter ( 4675):  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/flutter ( 4675):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
E/flutter ( 4675): , null)
E/flutter ( 4675): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter ( 4675): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
E/flutter ( 4675): <asynchronous suspension>
E/flutter ( 4675): #2      AndroidViewController._create (package:flutter/src/services/platform_views.dart:640:54)
E/flutter ( 4675): #3      AndroidViewController.setSize (package:flutter/src/services/platform_views.dart:557:14)
E/flutter ( 4675): #4      RenderAndroidView._sizePlatformView (package:flutter/src/rendering/platform_view.dart:174:29)
E/flutter ( 4675): #5      RenderAndroidView.performResize (package:flutter/src/rendering/platform_view.dart:155:5)
E/flutter ( 4675): #6      RenderObject.layout (package:flutter/src/rendering/object.dart:1703:9)
E/flutter ( 4675): #7      RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter ( 4675): #8      RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter ( 4675): #9      MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:163:11)
E/flutter ( 4675): #10     _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:477:7)
E/flutter ( 4675): #11     MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:232:7)
E/flutter ( 4675): #12     RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:391:14)
E/flutter ( 4675): #13     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter ( 4675): #14     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter ( 4675): #15     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter ( 4675): #16     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter ( 4675): #17     _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1232:11)
E/flutter ( 4675): #18     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter ( 4675): #19     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter ( 4675): #20     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter ( 4675): #21     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter ( 4675): #22     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter ( 4675): #23     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter ( 4675): #24     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter ( 4675): #25     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter ( 4675): #26     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter ( 4675): #27     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter ( 4675): #28     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter ( 4675): #29     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter ( 4675): #30     RenderObject.layout (package:flutter/src/rende

我已完成调试此错误的所有操作(尝试10次以上)。如果您能帮助我解决这个问题,请先谢谢。

萨汉(Sahan Dissanayaka)

希望我在运行这些命令flutter clean并在flutter pub cache repair命令行中找到答案时,它能正常工作。除此之外,我的模拟器还没有安装google paly服务。然后,当我重建并运行它时。它工作正常。

但是Google在实施下一版API时需要考虑这些例外情况

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

TOP 榜单

热门标签

归档