首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Flutter App在Android上使用Google Maps Flutter插件崩溃

Flutter App在Android上使用Google Maps Flutter插件崩溃
EN

Stack Overflow用户
提问于 2021-01-03 10:20:01
回答 2查看 1.9K关注 0票数 2

我正在尝试为flutter设置谷歌地图插件,遵循google_maps_flutter 1.0.6 https://pub.dev/packages/google_maps_flutter包的pub.dev中的自述文件。然而,这款应用程序在安卓上总是崩溃,在iOS上运行得很好。

以下是控制台的输出:

代码语言:javascript
复制
Running Gradle task 'assembleDebug'...
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app.apk...
Debug service listening on ws://127.0.0.1:58755/ub1_3ODfGto=/ws
Syncing files to device sdk gphone x86 arm...
I/FirebaseApp(16117): Device unlocked: initializing all Firebase APIs for app db2
I/zzbz    (16117): Making Creator dynamically
I/DynamiteModule(16117): Considering local module com.google.android.gms.maps_dynamite:0 and remote module com.google.android.gms.maps_dynamite:201817000
I/DynamiteModule(16117): Selected remote version of com.google.android.gms.maps_dynamite, version >= 201817000
V/DynamiteModule(16117): Dynamite loader version >= 2, using loadModule2NoCrashUtils
W/Gralloc4(16117): allocator 3.x is not supported
W/sharp.seeeA(16117): Unsupported class loader
W/sharp.seeeA(16117): Unsupported class loader
I/Google Maps Android API(16117): Google Play services client version: 12451000
I/Google Maps Android API(16117): Google Play services package version: 201817022
E/AndroidRuntime(16117): FATAL EXCEPTION: main
E/AndroidRuntime(16117): Process: net.visualsharp.cab_rider, PID: 16117
E/AndroidRuntime(16117): java.lang.AbstractMethodError: abstract method "void io.flutter.plugin.platform.PlatformView.onFlutterViewAttached(android.view.View)"
E/AndroidRuntime(16117):    at io.flutter.plugin.platform.VirtualDisplayController.onFlutterViewAttached(VirtualDisplayController.java:181)
E/AndroidRuntime(16117):    at io.flutter.plugin.platform.PlatformViewsController$1.createVirtualDisplayForPlatformView(PlatformViewsController.java:233)
E/AndroidRuntime(16117):    at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:104)
E/AndroidRuntime(16117):    at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
E/AndroidRuntime(16117):    at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/AndroidRuntime(16117):    at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/AndroidRuntime(16117):    at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:738)
E/AndroidRuntime(16117):    at android.os.MessageQueue.nativePollOnce(Native Method)
E/AndroidRuntime(16117):    at android.os.MessageQueue.next(MessageQueue.java:335)
E/AndroidRuntime(16117):    at android.os.Looper.loop(Looper.java:183)
E/AndroidRuntime(16117):    at android.app.ActivityThread.main(ActivityThread.java:7656)
E/AndroidRuntime(16117):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(16117):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/AndroidRuntime(16117):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
I/Process (16117): Sending signal. PID: 16117 SIG: 9
Lost connection to device.
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-01-03 10:23:02

minSdkVersion16改成24 .../android/app/build.gradle解决了这个问题。

票数 3
EN

Stack Overflow用户

发布于 2021-01-06 16:25:35

android.enableDexingArtifactTransform=false添加到gradle.properties

GitHub上的问题和解决方案。

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65546079

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档