【问题标题】:"Failed to resolve: org.junit:junit:4.12" with AndroidX Test JUnit“无法解决:org.junit:junit:4.12”与 AndroidX 测试 JUnit
【发布时间】:2018-10-09 10:35:55
【问题描述】:

当我尝试添加对 AndroidX Test JUnit 1.0.0-beta01:androidTestImplementation androidx.test.ext:junit:1.0.0-beta01 的依赖时,Gradle Sync 失败并出现以下错误:

无法解决:org.junit:junit:4.12

手动添加 org.junit 依赖项的所有操作也无济于事。

【问题讨论】:

  • 使用testImplementation 'junit:junit:4.12'
  • @RakeshKumar 这个依赖存在,它不会改变任何东西。
  • 我遇到了同样的问题。我们正在尝试用 ext 版本替换已弃用的 AndroidJUnit4,但看到了这个 org.junit:junit:4.12 问题。

标签: android junit android-testing androidx android-junit


【解决方案1】:

上述问题已在1.0.0-beta02

中修复

'androidTestImplementation "androidx.test.ext:junit:1.0.0-beta02'

【讨论】:

    【解决方案2】:

    您可以手动排除“org.junit”组。

    androidTestImplementation("androidx.test.ext:junit:1.0.0-beta01") {
        exclude group: "org.junit"
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-23
      • 2023-04-08
      • 1970-01-01
      • 2015-12-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多