在詹金斯建立gradle

时间:2015-03-24 08:39:57

标签: android jenkins gradle

我正在尝试使用gradle build构建一个Android应用程序。但是我收到以下错误。

10:48:36.851 [ERROR] [org.gradle.BuildExceptionReporter] A problem occurred configuring root project 'workspace'.    
10:48:36.851 [ERROR] [org.gradle.BuildExceptionReporter] > Could not resolve all dependencies for configuration ':classpath'.

10:48:36.852 [ERROR] [org.gradle.BuildExceptionReporter]    > Could not resolve com.android.tools.build:gradle:1.0.0.

10:48:36.852 [ERROR] [org.gradle.BuildExceptionReporter]      Required by:
10:48:36.853 [ERROR] [org.gradle.BuildExceptionReporter]          :workspace:unspecified

10:48:36.854 [ERROR] [org.gradle.BuildExceptionReporter]       > Could not GET 
'https://jcenter.bintray.com/com/android/tools/build/gradle/1.0.0/gradle-1.0.0.pom'.

10:48:36.854 [ERROR] [org.gradle.BuildExceptionReporter]          > peer not authenticated

我的全局build.gradle将如下所示。

apply plugin: 'android'
buildscript {    
repositories {    
    mavenCentral()  
}   

dependencies {
    classpath 'com.android.tools.build:gradle:0.10.+'
}
}

ext.multiarch=false

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
for (subproject in getProjectList()) {
    compile project(subproject)
}

}

在我的应用程序中,我有以下gradle文件。

apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
    applicationId "com.example.parthibans.myapplication"
    minSdkVersion 15
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}   
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
}

请任何人帮助我...

0 个答案:

没有答案