【问题标题】:Flutter App crashing on Android using Google Maps Flutter Plugin使用 Google Maps Flutter Plugin 在 Android 上崩溃的 Flutter App
【发布时间】:2021-04-09 06:23:31
【问题描述】:

我正在尝试设置 googles 地图插件,以便按照包 google_maps_flutter 1.0.6 https://pub.dev/packages/google_maps_flutter 的 pub.dev 中的自述文档进行颤动。 然而,该应用程序在 Android 上不断崩溃,在 iOS 上运行良好。

这是控制台的输出:

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.

【问题讨论】:

    标签: flutter google-maps


    【解决方案1】:

    将android.enableDexingArtifactTransform=false 添加到gradle.properties。

    GitHub 上的问题和此解决方案。

    【讨论】:

    【解决方案2】:

    在 .../android/app/build.gradle 中将 minSdkVersion 从 16 更改为 24 可解决此问题。

    【讨论】:

    • 它没有为我修复它
    猜你喜欢
    • 2020-04-01
    • 2021-10-09
    • 2021-05-27
    • 2020-01-31
    • 2021-03-24
    • 2019-07-17
    • 2020-07-22
    • 2019-08-15
    • 2022-06-13
    相关资源
    最近更新 更多