在 Android 上构建时出现“app:checkDebugDuplicateClasses”错误

"app:checkDebugDuplicateClasses" error when building on Android

提问人:Nicklas Nielsen 提问时间:10/25/2023 更新时间:10/25/2023 访问量:27

问:

我将 react-native-vision-camera 从 2.15.6 版更新到 3.5.1。但是,当我尝试构建应用程序时,我遇到了以下错误,以及许多重复的类错误:

* 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.73.0-rc-debug.3-debug-runtime (com.facebook.react:react-android:0.73.0-rc.3) and jetified-react-native-0.70-debug.5-debug-runtime (com.facebook.react:react-native:0.70.5)
     Duplicate class com.facebook.debug.holder.NoopPrinter found in modules jetified-react-android-0.73.0-rc-debug.3-debug-runtime (com.facebook.react:react-android:0.73.0-rc.3) and jetified-react-native-0.70-debug.5-debug-runtime (com.facebook.react:react-native:0.70.5)
     Duplicate class com.facebook.debug.holder.Printer found in modules jetified-react-android-0.73.0-rc-debug.3-debug-runtime (com.facebook.react:react-android:0.73.0-rc.3) and jetified-react-native-0.70-debug.5-debug-runtime (com.facebook.react:react-native:0.70.5)
     Duplicate class com.facebook.debug.holder.PrinterHolder found in modules jetified-react-android-0.73.0-rc-debug.3-debug-runtime (com.facebook.react:react-android:0.73.0-rc.3) and jetified-react-native-0.70-debug.5-debug-runtime (com.facebook.react:react-native:0.70.5)
     Duplicate class com.facebook.debug.tags.ReactDebugOverlayTags found in modules jetified-react-android-0.73.0-rc-debug.3-debug-runtime (com.facebook.react:react-android:0.73.0-rc.3) and jetified-react-native-0.70-debug.5-debug-runtime (com.facebook.react:react-native:0.70.5)
     Duplicate class com.facebook.fbreact.specs.NativeAccessibilityInfoSpec found in modules jetified-react-android-0.73.0-rc-debug.3-debug-runtime (com.facebook.react:react-android:0.73.0-rc.3) and jetified-react-native-0.70-debug.5-debug-runtime (com.facebook.react:react-native:0.70.5)
     Duplicate class com.facebook.fbreact.specs.NativeAccessibilityManagerSpec found in modules jetified-react-android-0.73.0-rc-debug.3-debug-runtime (com.facebook.react:react-android:0.73.0-rc.3) and jetified-react-native-0.70-debug.5-debug-runtime (com.facebook.react:react-native:0.70.5)
     Duplicate class com.facebook.fbreact.specs.NativeActionSheetManagerSpec found in modules jetified-react-android-0.73.0-rc-debug.3-debug-runtime (com.facebook.react:react-android:0.73.0-rc.3) and jetified-react-native-0.70-debug.5-debug-runtime (com.facebook.react:react-native:0.70.5)

我目前正在使用 React Native 版本 0.70.5,我不确定 0.73.0-rc3 来自哪里,除了它是在我安装 react-native-vision-camera 模块版本 3 后出现的。

我记得在将 0.71.0 版上传到 Maven Central 时,我以前版本的 React Native 遇到了问题。为了解决这个问题,我不得不将我的 React Native 版本更新到他们的补丁版本之一,因为我的应用程序开始从 Maven Central 拉取最新版本的 React Native。此信息可能与当前问题有关。

我试过清理和重建一切。

Android 构建错误 React-Native-Vision-Camera

评论


答: 暂无答案