未处理的异常:MissingPluginException(未找到通道flutter_inapp上方法initConnection的实现)。当我为android使用flutter应用内购买插件时,发生MissingPluginException异常。在 iOS 上,它运行良好
当我运行或调试应用程序时,它会给出以下错误:
E/flutter ( 7718): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method initConnection on channel flutter_inapp)
E/flutter ( 7718): #0 MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:157
E/flutter ( 7718): <asynchronous suspension>
E/flutter ( 7718): #1 MethodChannel.invokeMethod
package:flutter/…/services/platform_channel.dart:332
E/flutter ( 7718): #2 FlutterInappPurchase.initConnection
package:flutter_inapp_purchase/flutter_inapp_purchase.dart:85
E/flutter ( 7718): <asynchronous suspension>
E/flutter ( 7718): #3 PaymentService.initConnection
package:social_app/services/payment_service.dart:98
E/flutter ( 7718): #4 _CourseTabState.fetchCarevanAcademy
package:social_app/…/course_tab/course_tab.dart:96
E/flutter ( 7718): <asynchronous suspension>
E/flutter ( 7718): #5 _CourseTabState.initState
package:social_app/…/course_tab/course_tab.dart:38
E/flutter ( 7718): #6 StatefulElement._firstBuild
package:flutter/…/widgets/framework.dart:4765
E/flutter ( 7718): #7 ComponentElement.mount
package:flutter/…/widgets/framework.dart:4601
E/flutter ( 7718): #8 Element.inflateWidget
package:flutter/…/widgets/framework.dart:3569
E/flutter ( 7718): #9 MultiChildRenderObjectElement.mount
package:flutter/…/widgets/framework.dart:6236
E/flutter ( 7718): #10 Element.inflateWidget
package:flutter/…/widgets/framework.dart:3569
E/flutter ( 7718): #11 Element.updateChild
package:flutter/…/widgets/framework.dart:3327
E/flutter ( 7718): #12 ComponentElement.performRebuild
package:flutter/…/widgets/framework.dart:4652
E/flutter ( 7718): #13 Element.rebuild
package:flutter/…/widgets/framework.dart:4343
E/flutter ( 7718): #14 ComponentElement._firstBuild
package:flutter/…/widgets/framework.dart:4606
E/flutter ( 7718): #15 ComponentElement.mount
package:flutter/…/widgets/framework.dart:4601
E/flutter ( 7718): #16 Element.inflateWidget
package:flutter/…/widgets/framework.dart:3569
E/flutter ( 7718): #17 Element.updateChild
package:flutter/…/widgets/framework.dart:3327
E/flutter ( 7718): #18 ComponentElement.performRebuild
package:flutter/…/widgets/framework.dart:4652
E/flutter ( 7718): #19 Element.rebuild
package:flutter/…/widgets/framework.dart:4343
E/flutter ( 7718): #20 ComponentElement._firstBuild
package:flutter/…/widgets/framework.dart:4606
E/flutter ( 7718): #21 ComponentElement.mount
package:flutter/…/widgets/framework.dart:4601
E/flutter ( 7718): #22 Element.inflateWidget
package:flutter/…/widgets/framework.dart:3569
E/flutter ( 7718): #23 Element.updateChild
package:flutter/…/widgets/framework.dart:3327
E/flutter ( 7718): #24 ComponentElement.performRebuild
package:flutter/…/widgets/framework.dart:4652
E/flutter ( 7718): #25 Element.rebuild
package:flutter/…/widgets/framework.dart:4343
E/flutter ( 7718): #26 ComponentElement._firstBuild
package:flutter/…/widgets/framework.dart:4606
E/flutter ( 7718): #27 ComponentElement.mount
package:flutter/…/widgets/framework.dart:4601
E/flutter ( 7718): #28 Element.inflateWidget
package:flutter/…/widgets/framework.dart:3569
E/flutter ( 7718): #29 MultiChildRenderObjectElement.mount
package:flutter/…/widgets/framework.dart:6236
E/flutter ( 7718): #30 Element.inflateWidget
package:flutter/…/widgets/framework.dart:3569