简体   繁体   English

任务 ':app:checkDebugDuplicateClasses' 执行失败。 反应原生

[英]Execution failed for task ':app:checkDebugDuplicateClasses'. React Native

Execution failed for task ':app:checkDebugDuplicateClasses'.任务 ':app:checkDebugDuplicateClasses' 执行失败。

I have existing expo app which is working fine in expo, but for some requirements I have ejected it into react native cli after ejecting.我有现有的 expo 应用程序,该应用程序在 expo 中运行良好,但出于某些要求,我在弹出后将其弹出到反应原生 cli 中。 I'm running it in android using npx react-native run-android command but it throwing these error.我正在使用npx react-native run-android命令在 android 中运行它,但它抛出了这些错误。

I have tried gradlew clean, changes sdkVersion, and soo many solutions but none of them working.我尝试过gradlew clean、更改 sdkVersion和许多解决方案,但没有一个有效。

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable Duplicate class com.facebook.soloader.ApkSoSource found in modules jetified-react-native-0.20.1-runtime (com.facebook.react:react-native:0.20.1) and jetified-soloader-0.9.0-runtime (com.facebook.soloader:soloader:0.9.0) Duplicate class com.facebook.soloader.DirectorySoSource found in modules jetified-react-native-0.20.1-runtime (com.facebook.react:react-native:0.20.1) and jetified-soloader-0.9.0-runtime (com.facebook.soloader:soloader:0.9.0) Duplicate class Z4D236D9A2 A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable Duplicate class com.facebook.soloader.ApkSoSource found in modules jetified-react-native-0.20.1-runtime (com.facebook.react:react-native:0.20. 1) and jetified-soloader-0.9.0-runtime (com.facebook.soloader:soloader:0.9.0) Duplicate class com.facebook.soloader.DirectorySoSource found in modules jetified-react-native-0.20.1-runtime (com .facebook.react:react-native:0.20.1) and jetified-soloader-0.9.0-runtime (com.facebook.soloader:soloader:0.9.0) Duplicate class Z4D236D9A2 D102C5FE6AD1C50DA4BEC50Z.facebook.soloader.Elf32_Dyn found in modules jetified-react-native-0.20.1-runtime (com.facebook.react:react-native:0.20.1) and jetified-soloader-0.9.0-runtime (com.facebook.soloader:soloader:0.9.0) Duplicate class com.facebook.soloader.Elf32_Ehdr found in modules jetified-react-native-0.20.1-runtime (com.facebook.react:react-native:0.20.1) and jetified-soloader-0.9.0-runtime (com.facebook.soloader:soloader:0.9.0) Duplicate class com.facebook.soloader.Elf32_Phdr found in modules jetified-react-native-0.20.1-runtime (com.facebook.react:react-native:0.20.1) and jetified-soloade D102C5FE6AD1C50DA4BEC50Z.facebook.soloader.Elf32_Dyn found in modules jetified-react-native-0.20.1-runtime (com.facebook.react:react-native:0.20.1) and jetified-soloader-0.9.0-runtime (com.facebook.soloader :soloader:0.9.0) Duplicate class com.facebook.soloader.Elf32_Ehdr found in modules jetified-react-native-0.20.1-runtime (com.facebook.react:react-native:0.20.1) and jetified-soloader-0.9. 0-runtime (com.facebook.soloader:soloader:0.9.0) Duplicate class com.facebook.soloader.Elf32_Phdr found in modules jetified-react-native-0.20.1-runtime (com.facebook.react:react-native:0.20. 1)和jetified-soloade r-0.9.0-runtime (com.facebook.soloader:soloader:0.9.0) Duplicate class com.facebook.soloader.Elf32_Shdr found in modules jetified-react-native-0.20.1-runtime (com.facebook.react:react-native:0.20.1) and jetified-soloader-0.9.0-runtime (com.facebook.soloader:soloader:0.9.0) r-0.9.0-runtime (com.facebook.soloader:soloader:0.9.0) Duplicate class com.facebook.soloader.Elf32_Shdr found in modules jetified-react-native-0.20.1-runtime (com.facebook.react: react-native:0.20.1) 和 jetified-soloader-0.9.0-runtime (com.facebook.soloader:soloader:0.9.0)

This is my package.json这是我的 package.json

  "name": "mobile-app",
  "version": "1.0.0",
  "main": "__generated__/AppEntry.js",
  "private": true,
  "scripts": {
    "start": "react-native start",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "clear": "expo r -c",
    "eject": "expo eject",
    "update": "expo update"
  },
  "dependencies": {
    "@firebase/app-types": "0.6.1",
    "@mapbox/polyline": "1.1.1",
    "@react-native-async-storage/async-storage": "1.15.0",
    "@react-native-community/datetimepicker": "3.5.2",
    "@react-native-community/masked-view": "0.1.10",
    "@react-navigation/native": "5.7.5",
    "common": "1.0.0",
    "expo": "^1.0.0",
    "expo-apple-authentication": "3.2.1",
    "expo-asset": "8.3.3",
    "expo-av": "9.2.3",
    "expo-constants": "^13.0.2",
    "expo-crypto": "9.2.0",
    "expo-facebook": "11.3.1",
    "expo-firebase-recaptcha": "1.4.4",
    "expo-font": "9.2.1",
    "expo-image-picker": "10.2.2",
    "expo-localization": "10.2.0",
    "expo-location": "12.1.2",
    "expo-notifications": "^0.14.1",
    "expo-splash-screen": "~0.11.2",
    "expo-status-bar": "~1.0.4",
    "expo-task-manager": "9.2.2",
    "expo-updates": "^0.13.0",
    "firebase": "^8.10.1",
    "i18n-js": "3.8.0",
    "moment": "^2.29.3",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-native": "^0.68.1",
    "react-native-actions-sheet": "0.3.5",
    "react-native-dash": "0.0.11",
    "react-native-elements": "2.3.2",
    "react-native-gesture-handler": "1.10.2",
    "react-native-google-maps-directions": "2.1.1",
    "react-native-google-places-autocomplete": "1.8.0",
    "react-native-maps": "0.28.0",
    "react-native-modal-datetime-picker": "8.7.1",
    "react-native-picker-select": "7.0.0",
    "react-native-reanimated": "2.2.0",
    "react-native-safe-area-context": "3.2.0",
    "react-native-screens": "3.4.0",
    "react-native-segmented-control-tab": "3.4.1",
    "react-native-simple-radio-button": "2.7.4",
    "react-native-star-rating": "^1.0.8",
    "react-native-unimodules": "^0.15.0",
    "react-native-vector-icons": "7.0.0",
    "react-native-web": "^0.17.7",
    "react-native-webview": "11.6.2",
    "react-navigation": "4.3.7",
    "react-navigation-drawer": "2.7.1",
    "react-navigation-stack": "2.3.11",
    "react-redux": "7.2.0"
  },
  "devDependencies": {
    "@babel/core": "7.9.0",
    "babel-preset-expo": "8.3.0",
    "expo-yarn-workspaces": "1.2.1"
  }
}```

I am currently experiencing the same after ejecting from Expo SDK46.从 Expo SDK46 弹出后,我目前遇到了同样的情况。 I was running the command from a Makefile from an upper directory.我从上层目录的 Makefile 运行命令。

To get it to work I just manually navigated to the directory: cd./project_root and ran the command.为了让它工作,我只是手动导航到目录: cd./project_root并运行命令。 It seems like something in the CLI doesn't like it being run from a different directory other than your project root. CLI 中的某些内容似乎不喜欢从项目根目录以外的其他目录运行。

But I'm not sure if this will solve it for you但我不确定这是否会为你解决

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 React Native-任务':app:installDebug'的执行失败 - React Native - Execution failed for task ':app:installDebug' 任务':app:processDebugResources'的执行失败 - React Native - Execution failed for task ':app:processDebugResources' - React Native (React Native):任务 ':app:generatePackageList' 执行失败 - (React Native): Execution failed for task ':app:generatePackageList' 构建失败 - 任务:应用程序:checkDebugDuplicateClasses FAILED - Build Failed - Task :app:checkDebugDuplicateClasses FAILED 反应本机:BeoNews应用程序运行Android执行任务':app:transformClassesWithJarMergingForDebug'失败 - React-native: BeoNews app run-android Execution failed for task ':app:transformClassesWithJarMergingForDebug' 任务 ':react-native-camera:generateGeneralDebugRFile' 执行失败。 并构建失败 - Execution failed for task ':react-native-camera:generateGeneralDebugRFile'. and Build Failed 运行 react-native run-android 时任务 ':app:transformClassesWithDexForDebug' 执行失败 - Execution failed for task ':app:transformClassesWithDexForDebug' when running react-native run-android 反应本机任务:应用程序:安装调试失败 - React Native Task :app:installDebug FAILED 任务':react-native-device-info:processReleaseResources'的执行失败 - Execution failed for task ':react-native-device-info:processReleaseResources' 任务':react-native-admob:verifyReleaseResources'的执行失败 - Execution failed for task ':react-native-admob:verifyReleaseResources'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM