AndroidManifest.xml中的多个未解决的类使用shared_intent插件MissingPluginException时出错

问题描述

我知道我一次要问两个问题,但是我不知道它是否可以关联。

我无法解决AndroidManifest.xml中所有未解决的类

As you can see I get the red flags on multiple lines.

我已经尝试了多种方法

  1. Invalidating Caches/Restart
  2. Flutter clean
  3. 添加rest.clinimetric.MainActivity来尝试解决至少一个问题
  4. 创建一个简单的应用程序以检查是否会出现相同的错误。做到了。

这是使用插件receive_sharing_intent时遇到的整个错误。当我使用我的应用打开pdf时,它会弹出。我不知道该错误会在Pixel 3A上弹出,而在Samsung A40上不会弹出。我还缺少更具体的东西吗?

W/FlutterActivity(12757): Tried to automatically register plugins with FlutterEngine (io.Flutter.embedding.engine.FlutterEngine@fa044bb) but Could not find and invoke the GeneratedpluginRegistrant.
D/HostConnection(12757): HostConnection::get() New Host Connection established 0xf2754470,tid 12844
D/HostConnection(12757): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0 
D/EGL_emulation(12757): eglMakeCurrent: 0xf2542690: ver 3 0 (tinfo 0xbc509e10) (first time)
I/Choreographer(12757): Skipped 35 frames!  The application may be doing too much work on its main thread.

══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════
The following MissingPluginException was thrown while activating platform stream on channel
receive_sharing_intent/events-media:
MissingPluginException(No implementation found for method listen on channel
receive_sharing_intent/events-media)

When the exception was thrown,this was the stack:
#0      MethodChannel._invokeMethod (package:Flutter/src/services/platform_channel.dart:159:7)
<asynchronous suspension>
#1      MethodChannel.invokeMethod (package:Flutter/src/services/platform_channel.dart:334:12)
#2      EventChannel.receivebroadcastStream.<anonymous closure> (package:Flutter/src/services/platform_channel.dart:542:29)
#3      EventChannel.receivebroadcastStream.<anonymous closure> (package:Flutter/src/services/platform_channel.dart:528:64)
#8      CastStream.listen (dart:_internal/async_cast.dart:17:17)
#11     _ClinimetricHomePageState.initState (package:clinimetric/main.dart:147:47)
#12     StatefulElement._firstBuild (package:Flutter/src/widgets/framework.dart:4684:58)
#13     ComponentElement.mount (package:Flutter/src/widgets/framework.dart:4520:5)
...     normal element mounting (132 frames)
#145    Element.inflateWidget (package:Flutter/src/widgets/framework.dart:3490:14)
#146    MultiChildRenderObjectElement.mount (package:Flutter/src/widgets/framework.dart:5991:32)
...     normal element mounting (258 frames)
#404    Element.inflateWidget (package:Flutter/src/widgets/framework.dart:3490:14)
#405    Element.updateChild (package:Flutter/src/widgets/framework.dart:3258:18)
#406    ComponentElement.performRebuild (package:Flutter/src/widgets/framework.dart:4571:16)
#407    _InheritedProviderScopeElement.performRebuild (package:provider/src/inherited_provider.dart:397:11)
#408    Element.rebuild (package:Flutter/src/widgets/framework.dart:4262:5)
#409    ComponentElement._firstBuild (package:Flutter/src/widgets/framework.dart:4525:5)
#410    ComponentElement.mount (package:Flutter/src/widgets/framework.dart:4520:5)
...     normal element mounting (7 frames)
#417    SingleChildWidgetElementMixin.mount (package:nested/nested.dart:223:11)
...     normal element mounting (7 frames)
#424    _nestedHookElement.mount (package:nested/nested.dart:188:11)
...     normal element mounting (7 frames)
#431    SingleChildWidgetElementMixin.mount (package:nested/nested.dart:223:11)
#432    Element.inflateWidget (package:Flutter/src/widgets/framework.dart:3490:14)
#433    Element.updateChild (package:Flutter/src/widgets/framework.dart:3258:18)
#434    RenderObjectToWidgetElement._rebuild (package:Flutter/src/widgets/binding.dart:1174:16)
#435    RenderObjectToWidgetElement.mount (package:Flutter/src/widgets/binding.dart:1145:5)
#436    RenderObjectToWidgetAdapter.attachToRenderTree.<anonymous closure> (package:Flutter/src/widgets/binding.dart:1087:17)
#437    BuildOwner.buildScope (package:Flutter/src/widgets/framework.dart:2620:19)
#438    RenderObjectToWidgetAdapter.attachToRenderTree (package:Flutter/src/widgets/binding.dart:1086:13)
#439    WidgetsBinding.attachRootWidget (package:Flutter/src/widgets/binding.dart:927:7)
#440    WidgetsBinding.scheduleAttachRootWidget.<anonymous closure> (package:Flutter/src/widgets/binding.dart:908:7)
(elided 17 frames from class _RawReceivePortImpl,class _Timer,dart:async,and dart:async-patch)
════════════════════════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by services library ══════════════════════════════════════════════════════
The following MissingPluginException was thrown while activating platform stream on channel receive_sharing_intent/events-media:
MissingPluginException(No implementation found for method listen on channel receive_sharing_intent/events-media)

etc... because it's calling 4 functions,so for each of them the error pops up

谢谢!

解决方法

我无法复制清单文件中出现的相同错误。您是否尝试过运行完整的sample app并查看其是否有效?确保您使用的Android Studio和Flutter插件是最新的。

您也可以尝试运行flutter doctor来检查是否有任何错误或警告。