[issues] Execution failed for task ':app:checkDebugDuplicateClasses' [react-native]


버전

System:
  OS: macOS 15.0
  CPU: (10) arm64 Apple M2 Pro
  Memory: 971.14 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.1.0
    path: ~/.nvm/versions/node/v22.1.0/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.8.3
    path: ~/.nvm/versions/node/v22.1.0/bin/npm
  Watchman:
    version: 2024.07.01.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/abel/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.0
      - iOS 18.0
      - macOS 15.0
      - tvOS 18.0
      - visionOS 2.0
      - watchOS 11.0
  Android SDK:
    API Levels:
      - "28"
      - "29"
      - "30"
      - "31"
      - "33"
      - "33"
      - "34"
    Build Tools:
      - 28.0.3
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 33.0.1
      - 33.0.2
      - 34.0.0
    System Images:
      - android-28 | Intel x86 Atom
      - android-28 | Intel x86_64 Atom
      - android-29 | Intel x86 Atom
      - android-29 | Intel x86_64 Atom
      - android-30 | Intel x86_64 Atom
      - android-30 | Google APIs Intel x86 Atom
      - android-30 | Google APIs Intel x86_64 Atom
      - android-31 | Intel x86_64 Atom
      - android-31 | Google APIs Intel x86_64 Atom
      - android-33-ext5 | Google Play Intel x86_64 Atom
      - android-33 | Google APIs ARM 64 v8a
      - android-33 | Google APIs Intel x86_64 Atom
      - android-34 | Google APIs ARM 64 v8a
      - android-34 | Google APIs Intel x86_64 Atom
      - android-34 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2411.12169540
  Xcode:
    version: 16.0/16A242d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /opt/homebrew/opt/openjdk@17/bin/javac
  Ruby:
    version: 2.7.6
    path: /Users/abel/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

에러 코드

 Execution failed for task ':app:checkDebugDuplicateClasses'

발생 원인

  • 프로젝트에서 사용하는 라이브러리 중 일부가 AndroidX와 충돌을 일으켜서 발생

(1) : 해결 방법

  1. 해당 프로젝트의 루트 경로에서 android/gradle.properties에서 해당 코드 추가
android.enableJetifier=true
  1. useAndroidX=true는 프로젝트 생성 시 자동으로 추가되지만, enableJetifier=true는 적용되지 않는다.
재빌드