繁体   English   中英

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

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

任务 ':app:checkDebugDuplicateClasses' 执行失败。

我有现有的 expo 应用程序,该应用程序在 expo 中运行良好,但出于某些要求,我在弹出后将其弹出到反应原生 cli 中。 我正在使用npx react-native run-android命令在 android 中运行它,但它抛出了这些错误。

我尝试过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 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) 和 jetified-soloader-0.9.0-runtime (com.facebook.soloader:soloader:0.9.0)

这是我的 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"
  }
}```

从 Expo SDK46 弹出后,我目前遇到了同样的情况。 我从上层目录的 Makefile 运行命令。

为了让它工作,我只是手动导航到目录: cd./project_root并运行命令。 CLI 中的某些内容似乎不喜欢从项目根目录以外的其他目录运行。

但我不确定这是否会为你解决

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM