无法使用Gradle发行版'https://services.gradle.org/distributions/gradle-4.4-all.zip'运行构建操作

时间:2018-07-26 13:51:16

标签: android gradle

我最近将android studio从2.3升级到了3.1.3,并更新了其他所有提示更新的组件。但是今天早上,我试图创建一个新项目,并且在同步新项目之后,我收到了第一个错误,即我缺少android sdk平台26。我下载了它。然后就无法同步。不断下载

'https://dl.google.com/dl/android/maven2/com/android/tools/build/transform-api/2.0.0-deprecated-use-gradle-api/transform-api-2.0.0-deprecated-use-gradle-api.pom'
'https://dl.google.com/dl/android/maven2/org/ow2/asm/asm-analysis/5.1/asm-analysis-5.1.pom'  

和其他类似的内容。然后我得到一个普遍的错误

Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.4-all.zip'.

这是我的build.graddle(Module)

apply plugin: 'com.android.library'

android {
compileSdkVersion 26
defaultConfig {
    applicationId "com.wizal.com.themessage"
    minSdkVersion 19
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
dexOptions {

    // release & debug is in project animators
    matchingFallbacks = ['release', 'debug']
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

}

这是我的另一个build.graddle(project)

buildscript {

repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.3'


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

allprojects {
repositories {
    google()
    jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

我创建了另一个Android项目,但仍然收到相同的错误。第一个仍然运行良好。当我下载了sdk平台26时,一切就开始了。我会很感激一个解决方案,因为我一整天都在尝试修复它,但是仍然有用。

谢谢

0 个答案:

没有答案