android-摇篮:一个问题发生配置根项目机器人工作室 [英] android- Gradle: An issue occurred configuring root project android studio

查看:182
本文介绍了android-摇篮:一个问题发生配置根项目机器人工作室的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我迁移从日食到Android工作室。我已经创建一个新的项目,我想在genymotion运行它。当我preSS运行图标,它开始编译,给我这个错误:

I migrated from eclipse to android studio. I've create a new project and I want to run it on genymotion. When I press run icon, it begins to compile and give me this error :

Error:Gradle: A problem occurred configuring root project 'Khabar'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:1.1.0.
     Required by:
         :Khabardar:unspecified
      > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/1.1.0/gradle-1.1.0.pom'.
         > d29vzk4ow07wi7.cloudfront.net

这是我build.gradle的某些部分:

This is some parts of my build.gradle :

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 20
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "example.ir.khabar"
        minSdkVersion 8
        targetSdkVersion 20
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

build.gradle根:

build.gradle in root :

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 20
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "example.ir.khabar"
        minSdkVersion 8
        targetSdkVersion 20
        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:20.0.0'
    compile files('libs/universal-image-loader-1.8.4-with-sources.jar')
}

你能帮助我吗?我的摇篮版本是摇篮-2.2.1-所有

Could you help me? my gradle version is gradle-2.2.1-all

推荐答案

对于我来说,解决办法是增加而不是HTTPS的HTTP URL的jcenter,:

For me, the solution was to add the http url for jcenter, instead of https:

buildscript {
    repositories {
        jcenter {
            url "http://jcenter.bintray.com/"
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.0'

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

这篇关于android-摇篮:一个问题发生配置根项目机器人工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆