我尝试将firebase_messaging添加到我的应用程序中,并且每当该应用程序收到崩溃的推送通知时。应用终止/在后台还是前台都没关系。它总是崩溃。
错误:
E/flutter (27776): [ERROR:flutter/shell/platform/android/platform_view_android_jni.cc(40)] java.lang.NoClassDefFoundError: Failed resolution of: Lio/flutter/plugins/firebasemessaging/FlutterFirebaseInstanceIDService;
E/flutter (27776): at io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin.onMethodCall(FirebaseMessagingPlugin.java:103)
E/flutter (27776): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222)
E/flutter (27776): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
E/flutter (27776): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:643)
E/flutter (27776): at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (27776): at android.os.MessageQueue.next(MessageQueue.java:143)
E/flutter (27776): at android.os.Looper.loop(Looper.java:122)
E/flutter (27776): at android.app.ActivityThread.main(ActivityThread.java:5354)
E/flutter (27776): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (27776): at java.lang.reflect.Method.invoke(Method.java:372)
E/flutter (27776): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)
E/flutter (27776): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
E/flutter (27776): Caused by: java.lang.ClassNotFoundException: Didn't find class "io.flutter.plugins.firebasemessaging.FlutterFirebaseInstanceIDService" on path: DexPathList[[zip file "/data/app/br.com.jackson.armarios_inteligentes-1/base.apk"],nativeLibraryDirectories=[/data/app/br.com.jackson.armarios_inteligentes-1/lib/arm, /vendor/lib, /system/lib]]
E/flutter (27776): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
E/flutter (27776): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
E/flutter (27776): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
E/flutter (27776): ... 12 more
E/flutter (27776): Suppressed: java.lang.NoClassDefFoundError: io.flutter.plugins.firebasemessaging.FlutterFirebaseInstanceIDService
E/flutter (27776): at dalvik.system.DexFile.defineClassNative(Native Method)
E/flutter (27776): at dalvik.system.DexFile.defineClass(DexFile.java:226)
E/flutter (27776): at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
E/flutter (27776): at dalvik.system.DexPathList.findClass(DexPathList.java:321)
E/flutter (27776): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
E/flutter (27776): ... 14 more
E/flutter (27776): Suppressed: java.lang.ClassNotFoundException: io.flutter.plugins.firebasemessaging.FlutterFirebaseInstanceIDService
E/flutter (27776): at java.lang.Class.classForName(Native Method)
E/flutter (27776): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
E/flutter (27776): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
E/flutter (27776): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
E/flutter (27776): ... 13 more
E/flutter (27776): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
E/flutter (27776):
F/flutter (27776): [FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(77)] Check failed: CheckException(env).
我在Android正常情况下使用了这个项目firebase_messaging,但没问题,但在AndroidX中崩溃了