gpt4 book ai didi

firebase - Flutter- 自从添加 Cloud Messaging Android 应用程序崩溃

转载 作者:IT王子 更新时间:2023-10-29 07:03:06 25 4
gpt4 key购买 nike

自从我将云消息添加到我的 Flutter 应用程序后,该应用程序就在加载时崩溃了。

它在 iOS 上运行良好。

据我所知,它的所有设置都正确,而且它可以在 iOS 上运行,这让我不知所措..

这是 logcat 文件

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/internal/InternalTokenProvider;
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at java.lang.Class.forName(Class.java:378)
at com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-common@@17.0.0:78)
at com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-common@@17.0.0:71)
at com.google.firebase.FirebaseApp.<init>(com.google.firebase:firebase-common@@17.0.0:468)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.0.0:354)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.0.0:321)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.0.0:305)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@17.0.0:53)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1917)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1892)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@17.0.0:47)
at android.app.ActivityThread.installProvider(ActivityThread.java:6391)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5938)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5853)
at android.app.ActivityThread.access$1100(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
2019-06-05 13:02:06.390 7346-7346/? E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.internal.InternalTokenProvider" on path: DexPathList[[zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/base.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_dependencies_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_resources_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_0_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_1_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_2_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_3_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_4_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_5_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_6_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_7_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_8_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/base.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_dependencies_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_resources_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_0_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_1_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_2_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_3_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_4_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_5_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_6_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_7_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_8_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_9_apk.apk!/lib/x86, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 24 more
Suppressed: java.io.IOException: No original dex files found for dex location /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_resources_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:354)
at dalvik.system.DexFile.<init>(DexFile.java:101)
at dalvik.system.DexFile.<init>(DexFile.java:75)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:394)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:354)
at dalvik.system.DexPathList.<init>(DexPathList.java:164)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:74)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
2019-06-05 13:02:06.391 7346-7346/? E/AndroidRuntime: at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:74)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:40)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:727)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:810)
at android.app.LoadedApk.getResources(LoadedApk.java:1032)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2345)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5749)
... 8 more

我已确保将以下内容添加到我的 list 中

<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

最佳答案

打开android项目。

去firebase_messaging的build.gradle

在依赖项中将 api 'com.google.firebase:firebase-messaging:18.0.0' 更改为 api 'com.google.firebase:firebase-messaging:17.3.3'

确保您使用的是 pubspec.yaml 中所有云依赖项的最新版本

这个解决方案对我有用

关于firebase - Flutter- 自从添加 Cloud Messaging Android 应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56465080/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com