首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法解析Junit:Junit:12

无法解析Junit:Junit:12
EN

Stack Overflow用户
提问于 2016-05-03 13:47:19
回答 2查看 21K关注 0票数 7

当我尝试在android studio中运行我的第一个应用程序时,我得到了以下错误

代码语言:javascript
复制
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugUnitTestCompile'.
   > Could not resolve junit:junit:4.12.
     Required by:
         Hellow_World:app:unspecified
      > Could not resolve junit:junit:4.12.
         > Could not get resource 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom'.
            > Could not GET 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom'.
               > jcenter.bintray.com

以下是我的Gradle.script(模块)

代码语言:javascript
复制
apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.example.administrator.hellow_world"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.3.0'
}

以下是我的Gradle.script(Hellow_World)

代码语言:javascript
复制
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

有人能帮我修一下这个烂摊子吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-05-03 14:01:31

请遵循下面提到的路径:

右键单击您的应用程序/项目->

打开模块设置->

转到"Dependencies“选项卡->

你会找到"junit:junit:4.12“->

选中它并单击鼠标右键,然后选择remove option -> ok

现在再次尝试构建您的应用程序。

票数 8
EN

Stack Overflow用户

发布于 2017-02-23 01:47:50

删除代码中的以下行

testCompile 'junit:junit:4.12‘

然后编译它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36996527

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档