Unhandled Exception: PlatformException(error, java.lang.IllegalStateException: Trying to create a platform view of unregistered type: yandex_mapkit/yandex_map
This exception occurred when trying to run my flutter application in debug mode.
Log output:
E/flutter (29324): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, java.lang.IllegalStateException: Trying to create a platform view of unregistered type: yandex_mapkit/yandex_map
E/flutter (29324): at io.flutter.plugin.platform.PlatformViewsController$1.createForTextureLayer(PlatformViewsController.java:189)
E/flutter (29324): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:122)
E/flutter (29324): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:60)
E/flutter (29324): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
E/flutter (29324): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/flutter (29324): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$DartMessenger(DartMessenger.java:319)
E/flutter (29324): at io.flutter.embedding.engine.dart.-$$Lambda$DartMessenger$AIEPqY6mWzaNK15HekX9bftoAXs.run(Unknown Source:12)
E/flutter (29324): at android.os.Handler.handleCallback(Handler.java:938)
E/flutter (29324): at android.os.Handler.dispatchMessage(Handler.java:99)
E/flutter (29324): at android.os.Looper.loop(Looper.java:246)
E/flutter (29324): at android.app.ActivityThread.main(ActivityThread.java:8633)
E/flutter (29324): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (29324): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
E/flutter (29324): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
E/flutter (29324): , null, null)
E/flutter (29324): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:628:7)
E/flutter (29324): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:167:18)
E/flutter (29324): <asynchronous suspension>
E/flutter (29324): #2 TextureAndroidViewController._sendCreateMessage (package:flutter/src/services/platform_views.dart:1107:18)
E/flutter (29324): <asynchronous suspension>
E/flutter (29324): #3 AndroidViewController.create (package:flutter/src/services/platform_views.dart:762:5)
E/flutter (29324): <asynchronous suspension>
E/flutter (29324):
flutter doctor -v:
[√] Flutter (Channel master, 3.1.0-0.0.pre.729, on Microsoft Windows [Version 10.0.19043.1645], locale en-US)
• Flutter version 3.1.0-0.0.pre.729 at c:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision e01522c83e (31 hours ago), 2022-05-16 04:49:06 -0400
• Engine revision c40bc1313c
• Dart version 2.18.0 (build 2.18.0-116.0.dev)
• DevTools version 2.13.1
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\dc\AppData\Local\Android\sdk
• Platform android-31, build-tools 30.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.0)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.2.32505.173
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[√] VS Code (version 1.63.2)
• VS Code at C:\Users\dc\AppData\Local\Programs\Microsoft VS Code
• Flutter extension can be installed from:
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (4 available)
• SM A217F (mobile) • RF8R5184E4W • android-arm64 • Android 11 (API 30)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19043.1645]
• Chrome (web) • chrome • web-javascript • Google Chrome 101.0.4951.54
• Edge (web) • edge • web-javascript • Microsoft Edge 100.0.1185.36
[√] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.untitled16">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application
android:label="untitled16"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
I have did flutter clean more than one and uninstall app and use different emulator, the error is same