Duplicate class com.facebook.. found in modules jetified-react-android-0.71-debug.3-debug-runtime and jetified-react-native-0.69-debug.2-debug-runtime

huangapple go评论88阅读模式
英文:

Duplicate class com.facebook.. found in modules jetified-react-android-0.71-debug.3-debug-runtime and jetified-react-native-0.69-debug.2-debug-runtime

问题

以下是要翻译的部分:

[com.facebook.react:react-native:0.69.2] /Users/gagangupta/.gradle/caches/transforms-3/0f1732d94a06d041909e2f52d4f8dad0/transformed/jetified-react-native-0.69.2-debug/AndroidManifest.xml Warning:
Package name 'com.facebook.react' used in: com.facebook.react:react-native:0.69.2, com.facebook.react:react-android:0.71.3.

> Task :app:checkDebugDuplicateClasses FAILED
ReactNativeFirebase WARNING: NPM package '@react-native-firebase/remote-config' depends on '@react-native-firebase/app' v17.3.0 but found v15.7.1, this might cause build issues or runtime crashes.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
335 actionable tasks: 13 executed, 322 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class com.facebook.debug.debugoverlay.model.DebugOverlayTag found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
     Duplicate class com.facebook.debug.holder.NoopPrinter found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
     Duplicate class com.facebook.debug.holder.Printer found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69.debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
     ...
     (接下来是一系列类名重复的错误信息)
deleted gradle cache, tried cleaning and deleting node modules
英文:

[com.facebook.react:react-native:0.69.2] /Users/gagangupta/.gradle/caches/transforms-3/0f1732d94a06d041909e2f52d4f8dad0/transformed/jetified-react-native-0.69.2-debug/AndroidManifest.xml Warning:
Package name 'com.facebook.react' used in: com.facebook.react:react-native:0.69.2, com.facebook.react:react-android:0.71.3.

> Task :app:checkDebugDuplicateClasses FAILED
ReactNativeFirebase WARNING: NPM package '@react-native-firebase/remote-config' depends on '@react-native-firebase/app' v17.3.0 but found v15.7.1, this might cause build issues or runtime crashes.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
335 actionable tasks: 13 executed, 322 up-to-date

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:checkDebugDuplicateClasses'.
    > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
    > Duplicate class com.facebook.debug.debugoverlay.model.DebugOverlayTag found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.debug.holder.NoopPrinter found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.debug.holder.Printer found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.debug.holder.PrinterHolder found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.debug.tags.ReactDebugOverlayTags found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeAccessibilityInfoSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeAccessibilityManagerSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeActionSheetManagerSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeAlertManagerSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeAnimatedModuleSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeAnimatedTurboModuleSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeAnimationsDebugModuleSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeAppStateSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeAppearanceSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeBlobModuleSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeBugReportingSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeClipboardSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeDatePickerAndroidSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeDevLoadingViewSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeDevMenuSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeDevSettingsSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeDevSplitBundleLoaderSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeDeviceEventManagerSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeDeviceInfoSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeDialogManagerAndroidSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeExceptionsManagerSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeFileReaderModuleSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeFrameRateLoggerSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeHeadlessJsTaskSupportSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)
    Duplicate class com.facebook.fbreact.specs.NativeI18nManagerSpec found in modules jetified-react-android-0.71-debug.3-debug-runtime (com.facebook.react:react-android:0.71.3) and jetified-react-native-0.69-debug.2-debug-runtime (com.facebook.react:react-native:0.69.2)

deleted gradle cache, tried cleaning and deleting node modules

答案1

得分: 1

根据 https://stackoverflow.com/questions/56695106/duplicated-classes-found-in-modules-classes-jar 中的参考,我找到了一个解决方案:

在 android/app/build.gradle 中,在 Android {} 节点中添加以下内容

android {
...
    configurations {
        all*.exclude group: "com.facebook.react", module: "react-native"
    }
}

原因是某些依赖包在它们的 build.gradle 中仍然使用 "react-native" 而不是 "react-android"。

implementation 'com.facebook.react:react-native:+'

英文:

By reference https://stackoverflow.com/questions/56695106/duplicated-classes-found-in-modules-classes-jar, I figured out a solution:

In android/app/build.gradle, add following in your Android {} node

android {
...
    configurations {
        all*.exclude group: "com.facebook.react", module: "react-native"
    }
}

The reason is that some dependency packages still using "react-native" instead of "react-android" in their build.gradle.
> implementation 'com.facebook.react:react-native:+'

huangapple
  • 本文由 发表于 2023年2月24日 01:52:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/75548548.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定