不能同时运行audio_service和firebase_messaging

时间:2019-12-17 06:46:24

标签: flutter firebase-cloud-messaging

在我的项目中,audio_service和firebase_messaging不能一起工作。

错误消息是:

  

E / flutter(5794):[错误:flutter / lib / ui / ui_dart_state.cc(157)]未处理的异常:PlatformException(错误,尝试调用虚拟方法'void com.ryanheise.audioservice.AudioServicePlugin $ BackgroundHandler。 init(io.flutter.plugin.common.PluginRegistry $ Registrar)'在空对象引用上,null)E / flutter(5794):#0 StandardMethodCodec.decodeEnvelope(package:flutter / src / services / message_codecs.dart:569: 7)E / flutter(5794):#1 MethodChannel.invokeMethod(package:flutter / src / services / platform_channel.dart:321:33)E / flutter(5794):E / flutter(5794):#2 FirebaseMessaging.configure (package:firebase_messaging / firebase_messaging.dart:118:16)E / flutter(5794):#4 StatefulElement.build(package:flutter / src / widgets / framework.dart:4334:27)E / flutter(5794):# 5 ComponentElement.performRebuild(package:flutter / src / widgets / framework.dart:4223:15)E / flutter(5794):#6 Element.rebuild(package:flutter / src / widgets / framework.dart:3947:5) E / flutter(5794):#7 ComponentElement._firstB uild(package:flutter / src / widgets / framework.dart:4206:5)E / flutter(5794):#8 StatefulElement._firstBuild(package:flutter / src / widgets / framework.dart:4381:11)E / flutter (5794):#9 ComponentElement.mount(包:flutter / src / widgets / framework.dart:4201:5)E / flutter(5794):#10 Element.inflateWidget(包:flutter / src / widgets / framework.dart :3194:14)E / flutter(5794):#11 Element.updateChild(package:flutter / src / widgets / framework.dart:2988:12)E / flutter(5794):#12 SingleChildRenderObjectElement.mount(package:flutter /src/widgets/framework.dart:5445:14)E / flutter(5794):#13 Element.inflateWidget(package:flutter / src / widgets / framework.dart:3194:14)E / flutter(5794):# 14 Element.updateChild(package:flutter / src / widgets / framework.dart:2988:12)E / flutter(5794):#15 ComponentElement.performRebuild(package:flutter / src / widgets / framework.dart:4243:16) E / flutter(5794):#16 Element.rebuild(包:flutter / src / widgets / framework.dart:3947:5)E / flutter(5794):#17 ComponentElement._fi rstBuild(包:flutter / src / widgets / framework.dart:4206:5)E / flutter(5794):#18 ComponentElement.mount(包:flutter / src / widgets / framework.dart:4201:5)E / flutter (5794):#19 Element.inflateWidget(package:flutter / src / widgets / framework.dart:3194:14)E / flutter(5794):#20 Element.updateChild(package:flutter / src / widgets / framework.dart :2988:12)E / flutter(5794):#21 SingleChildRenderObjectElement.mount(包:flutter / src / widgets / framework.dart:5445:14)E / flutter(5794):#22 Element.inflateWidget(package:flutter /src/widgets/framework.dart:3194:14)E / flutter(5794):#23 Element.updateChild(package:flutter / src / widgets / framework.dart:2988:12)E / flutter(5794):# 24 SingleChildRenderObjectElement.mount(包:flutter / src / widgets / framework.dart:5445:14)E / flutter(5794):#25 Element.inflateWidget(包:flutter / src / widgets / framework.dart:3194:14) E / flutter(5794):#26 Element.updateChild(package:flutter / src / widgets / framework.dart:2988:12)E / flutter(5794):#27 ComponentE lement.performRebuild(package:flutter / src / widgets / framework.dart:4243:16)E / flutter(5794):#28 Element.rebuild(package:flutter / src / widgets / framework.dart:3947:5)E / flutter(5794):#29 ComponentElement._firstBuild(package:flutter / src / widgets / framework.dart:4206:5)E / flutter(5794):#30 StatefulElement._firstBuild(package:flutter / src / widgets / framework .dart:4381:11)E / flutter(5794):#31 ComponentElement.mount(包:flutter / src / widgets / framework.dart:4201:5)E / flutter(5794):#32 Element.inflateWidget(package :flutter / src / widgets / framework.dart:3194:14)E / flutter(5794):#33 Element.updateChild(package:flutter / src / widgets / framework.dart:2988:12)E / flutter(5794) :#34 SingleChildRenderObjectElement.mount(包:flutter / src / widgets / framework.dart:5445:14)E / flutter(5794):#35 Element.inflateWidget(包:flutter / src / widgets / framework.dart:3194: 14)E / flutter(5794):#36 Element.updateChild(package:flutter / src / widgets / framework.dart:2988:12)E / flutter(5794):#37 Sing leChildRenderObjectElement.mount(包:flutter / src / widgets / framework.dart:5445:14)E / flutter(5794):#38 Element.inflateWidget(包:flutter / src / widgets / framework.dart:3194:14)E / flutter(5794):#39 Element.updateChild(package:flutter / src / widgets / framework.dart:2988:12)E / flutter(5794):#40 ComponentElement.performRebuild(package:flutter / src / widgets / framework .dart:4243:16)E / flutter(5794):#41 Element.rebuild(package:flutter / src / widgets / framework.dart:3947:5)E / flutter(5794):#42 ComponentElement._firstBuild(package :flutter / src / widgets / framework.dart:4206:5)E / flutter(5794):#43 StatefulElement._firs E / flutter(5794):[错误:flutter / lib / ui / ui_dart_state.cc(157)]未处理的异常:MissingPluginException(未在渠道plugins.flutter.io/firebase_messaging_background上初始化为方法FcmDartService#的实现)E / flutter(5794):#0 MethodChannel.invokeMethod(package:flutter / src / services / platform_channel.dart:319: 7)E /颤振(5794):E /颤振(5 794):#1 _fcmSetupBackgroundChannel(package:firebase_messaging / firebase_messaging.dart:50:21)E / flutter(5794):#2 _AsyncAwaitCompleter.start(dart:async-patch / async_patch.dart:45:6)E / flutter( 5794):#3 _fcmSetupBackgroundChannel(软件包:firebase_messaging / firebase_messaging.dart:23:32)E / flutter(5794):#4 _runMainZoned ..(dart:ui / hooks.dart:239:25)E / flutter(5794) :#5 _rootRun(dart:async / zone.dart:1126:13)E / flutter(5794):#6 _CustomZone.run(dart:async / zone.dart:1023:19)E / flutter(5794):# 7 _runZoned(dart:async / zone.dart:1518:10)E / flutter(5794):#8 runZoned(dart:async / zone.dart:1502:12)E / flutter(5794):#9 _runMainZoned。 (dart:ui / hooks.dart:231:5)E / flutter(5794):#10 _startIsolate。 (dart:isolate-patch / isolate_patch.dart:307:19)E / flutter(5794):#11 _RawReceivePortImpl._handleMessage(dart:isolate-patch / isolate_patch.dart:174:12)*

有人对此错误有任何想法吗?

谢谢!

0 个答案:

没有答案