Push-уведомление для AndroidX - Flutter - PullRequest
0 голосов
/ 26 сентября 2019

Я пытался добавить firebase_messaging в свое приложение, и каждый раз, когда приложение получает push-уведомление, происходит сбой.Не имеет значения, если приложение завершено / в фоновом режиме или на переднем плане.Он всегда вылетает.

Ошибки:

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). 

Я использовал этот проект firebase_messaging в Android нормально, все нормально, но в AndroidX вылетело

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...