两个依赖项的Gradle构建失败

时间:2016-03-25 22:15:54

标签: android android-studio build.gradle

我正在尝试使用以下依赖项构建gradle。但它没有编译。通过查看论坛来改变版本我已经尝试了很多。我在项目结构对话框中搜索依赖项,并找到以下两个。

de.hdodenhof:circleimageview:2.0.0
com.mcxiaoke.volley:library-aar:1.0.1

其实我用的是两台电脑。这是在另一台具有以下

的电脑中构建的
de.hdodenhof:circleimageview:1.2.1
com.mcxiaoke.volley:library-aar:1.0.19

仍然没有运气,每次花费20-25分钟的gradle构建

Main build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.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
}

App build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

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

repositories {
    mavenCentral()
}

dependencies {

    compile('com.mapbox.mapboxsdk:mapbox-android-sdk:0.7.4@aar') {
        transitive = true
    }
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'com.mcxiaoke.volley:library:1.0.19'
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:design:23.1.0'
    compile 'com.android.support:recyclerview-v7:23.0'
}

1 个答案:

答案 0 :(得分:1)

这听起来像gradle无法访问远程存储库。您的防火墙阻止它,您的互联网连接是否正常工作,......?