[英]Unhandled Exception: MissingPluginException(No implementation found for method X on channel plugins.flutter.io/Y)
[英]FLUTTER Unhandled Exception: MissingPluginException(No implementation found for method map#waitForMap on channel plugins.flutter.io/google_maps_0)
我在我的 Flutter 項目中很好地集成了 Google Map。 幾天來,我在 Android 模擬器、Android 設備和 iOS 模擬器上對其進行了測試。 一切似乎都很好。 然后我主要集中在 iOS Simulator 上進行測試。 但是昨晚,當我在 Android 設備和仿真器上運行項目時,map 打開但沒有響應。 我有這個錯誤:
**E/flutter (18971): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method map#waitForMap on channel plugins.flutter.io/google_maps_0)
E/flutter (18971): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:165:7)
E/flutter (18971): <asynchronous suspension>
E/flutter (18971): #1 GoogleMapController.init (package:google_maps_flutter/src/controller.dart:30:5)
E/flutter (18971): <asynchronous suspension>
E/flutter (18971): #2 _GoogleMapState.onPlatformViewCreated (package:google_maps_flutter/src/google_map.dart:394:44)
E/flutter (18971): <asynchronous suspension>
E/flutter (18971):**
This error only affects the Android side, not the iOS one, Upon investigating, I found out that the Google Map Controller was failing to initialize, What can be the cause? 以及如何解決?
在android/app/build.gradle中設置minSdkVersion
android {
defaultConfig {
minSdkVersion 20
}
}
在應用程序清單android/app/src/main/AndroidManifest.xml中指定您的 API 密鑰
<manifest ...
<application ...
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="YOUR KEY HERE"/>
運行flutter clean
, flutter pub get
然后flutter run
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.