gpt4 book ai didi

机器人 Gradle : An issue occurred configuring root project android studio

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:00:26 24 4
gpt4 key购买 nike

我从 eclipse 迁移到 android studio。我创建了一个新项目,我想在 genymotion 上运行它。当我按下运行图标时,它开始编译并给我这个错误:

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 的一些部分:

    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'
}
}
}

root 中的 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'
}
}
}

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')
}

你能帮帮我吗?我的 gradle 版本是 gradle-2.2.1-all

最佳答案

对我来说,解决方案是为 jcenter 添加 http url,而不是 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
}
}

关于机器人 Gradle : An issue occurred configuring root project android studio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29715890/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com