【问题标题】:More than one file was found with OS independent path 'junit/runner/logo.gif'找到多个文件,其独立于操作系统的路径为“junit/runner/logo.gif”
【发布时间】:2020-09-14 11:17:43
【问题描述】:

我正在做一个项目,我需要使用 ESC-POS 建立与打印机的连接。项目是本机反应,我目前在 Android 模拟器上进行测试。 我找到了可以满足我需求的包 (https://github.com/leesiongchan/react-native-esc-pos),但是当我尝试构建一个应用程序时,它会出现 330 多个错误,例如:

在模块 escposjava-1.0-SNAPSHOT.jar (escposjava-1.0-SNAPSHOT.jar) 和 junit-4.12.jar (junit:junit:4.12) 中发现重复的类 org.junit.runners.model.MultipleFailureException`

任务 :app:mergeDebugJavaResource 出现这些错误,消息是:

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
More than one file was found with OS independent path 'junit/runner/logo.gif'

我尝试应用此问题的答案:More than one file was found with OS independent path 'META-INF/LICENSE',但没有任何改变。

我们将不胜感激。

项目依赖

"dependencies": {
    "@leesiongchan/react-native-esc-pos": "^0.8.0",
    "@react-native-community/datetimepicker": "^2.6.0",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-navigation/bottom-tabs": "^5.5.2",
    "@react-navigation/drawer": "^5.9.0",
    "@react-navigation/material-top-tabs": "^5.2.16",
    "@react-navigation/native": "^5.7.3",
    "@react-navigation/stack": "^5.9.0",
    "axios": "^0.19.2",
    "currency.js": "^2.0.3",
    "formik": "^2.1.4",
    "i18n-js": "^3.7.0",
    "moment": "^2.27.0",
    "native-base": "^2.12.1",
    "react": "16.13.1",
    "react-native": "0.62.2",
    "react-native-calendars": "^1.300.0",
    "react-native-elements": "^2.3.2",
    "react-native-gesture-handler": "^1.6.1",
    "react-native-html-to-pdf": "^0.8.0",
    "react-native-keyboard-aware-scroll-view": "^0.9.2",
    "react-native-localize": "^1.4.0",
    "react-native-masked-text": "^1.13.0",
    "react-native-modal": "^11.5.6",
    "react-native-modal-datetime-picker": "^8.7.1",
    "react-native-paper": "^3.10.1",
    "react-native-print": "^0.6.0",
    "react-native-reanimated": "~1.7.0",
    "react-native-safe-area-context": "0.7.3",
    "react-native-screens": "~2.2.0",
    "react-native-size-matters": "^0.3.0",
    "react-native-sqlite-storage": "modified for project",
    "react-native-tab-view": "^2.14.4",
    "react-native-vector-icons": "6.6.0",
    "react-redux": "^7.2.0",
    "redux": "^4.0.5",
    "redux-saga": "^1.1.3",
    "reflect-metadata": "^0.1.13",
    "typeorm": "modified for project",
    "url": "^0.11.0",
    "yup": "^0.29.1"
  },

【问题讨论】:

  • 你应该排除重复类。在你的依赖实现中('com.android.junit:4.x.x', { exclude group: 'groupname', module: 'modulename' })

标签: android react-native


【解决方案1】:

我一直在寻找其他与android相关的问题,终于找到了这个:

Duplicate Hamcrest and JUnit classes after updating Gradle and Android Studio to 3.5

所以基本上我所做的只是添加到 build.gradle (:app)

android {
    ...

    configurations {
        compile.exclude group: "junit", module: "junit"
    }

    ...
}

现在项目构建和应用启动。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多