android 任务:应用程序:检查调试重复类失败java.lang.运行时异常:找到重复的类

mi7gmzs6  于 2022-11-20  发布在  Android
关注(0)|答案(4)|浏览(126)

当我上次做了一些修改的时候,这个应用程序运行得很好。但是突然出现了FireBase的问题。

implementation project(':react-native-firebase')
    implementation 'com.android.support:support-v4:+'
    implementation 'com.google.firebase:firebase-core:16.0.9'
    implementation project(':react-native-device-info')
    implementation project(':react-native-vector-icons')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    ..... other dependencies
    implementation 'com.google.firebase:firebase-messaging:16.1.0

获取错误

Duplicate class com.google.android.gms.internal.firebase_messaging.zza found in modules jetified-firebase-iid-17.1.2-runtime.jar (com.google.firebase:firebase-iid:17.1.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzb found in modules jetified-firebase-iid-17.1.2-runtime.jar (com.google.firebase:firebase-iid:17.1.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzc found in modules jetified-firebase-iid-17.1.2-runtime.jar (com.google.firebase:firebase-iid:17.1.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzd found in modules jetified-firebase-iid-17.1.2-runtime.jar (com.google.firebase:firebase-iid:17.1.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zze found in modules jetified-firebase-iid-17.1.2-runtime.jar (com.google.firebase:firebase-iid:17.1.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzf found in modules jetified-firebase-iid-17.1.2-runtime.jar (com.google.firebase:firebase-iid:17.1.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzh found in modules jetified-firebase-iid-17.1.2-runtime.jar (com.google.firebase:firebase-iid:17.1.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzm found in modules jetified-firebase-iid-17.1.2-runtime.jar (com.google.firebase:firebase-iid:17.1.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzn found in modules jetified-firebase-iid-17.1.2-runtime.jar (com.google.firebase:firebase-iid:17.1.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzo found in modules jetified-firebase-iid-17.1.2-runtime.jar (com.google.firebase:firebase-iid:17.1.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzp found in modules jetified-firebase-iid-17.1.2-runtime.jar (com.google.firebase:firebase-iid:17.1.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzq found in modules jetified-firebase-iid-17.1.2-runtime.jar (com.google.firebase:firebase-iid:17.1.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzr found in modules jetified-firebase-iid-17.1.2-runtime.jar (com.google.firebase:firebase-iid:17.1.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.firebase.iid.FirebaseInstanceIdReceiver found in modules jetified-firebase-iid-17.1.2-runtime.jar (com.google.firebase:firebase-iid:17.1.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)

Go to the documentation to learn how to Fix dependency resolution errors.
l0oc07j2

l0oc07j21#

我在这里遇到了同样问题,突然安卓停止工作。我使用的是react-native 0.61.5。
这里有三种方法可以解决这个问题:

第一种方式:(解决了我的问题)在您的android/build.gradle上,将此行添加到扩展部分:

firebaseVersion = "21.1.0"

第二种方式:(也解决了我的问题)如果第一种方法不起作用,也许你应该做多一点。在你的android/buld.gradle中:

firebaseMessagingVersion = "21.1.0"
   buildToolsVersion = "29.0.2"
   firebaseCoreVersion = "17.0.0"
   firebaseVersion = "21.1.0"

在您android/app/build.gradle上,添加以下内容:

implementation 'com.google.firebase:firebase-messaging:21.1.0'

"第三条路"
您需要找到所有阻碍您应用的firebase依赖项,注意node_modules依赖项使用与firebase相关的内容。Map所有依赖项后,您需要指定android/build.gradleandroid/app/build.gradle上的版本。

**备注:**对不起,我的英语,我尝试。

6yt4nkrj

6yt4nkrj2#

我有这个问题,我发现firebase-iid工作在相同的版本比firebase-messaging,但现在的消息版本是22.0.0和市长版本的firebase-iid是21.1.0,所以你必须分开的依赖关系与每个相应的版本。

xriantvc

xriantvc3#

在以下firebase消息传递版本实现中使用'com.google.firebase:firebase消息传递:21.1.0'
祝您好运!

arknldoa

arknldoa4#

删除上的implementation 'com.google.firebase:firebase-analytics

安卓/应用程序/构建版本.gradle

相关问题