【发布时间】:2019-08-27 18:28:10
【问题描述】:
我从 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'
}
}
}
根目录下的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
【问题讨论】:
-
将 build.gradle 发布到根文件夹中。
-
@GabrieleMariotti 感谢您的回复,我编辑我的答案并在根文件夹中添加 build.gradle
-
你有什么“buildscript”部分?
-
@mohamadbagheri 你确定你的文件在根目录吗?
-
有更新的人吗?
标签: android