Android Gradle 3.0.0-ZLIB输入流意外结束 [英] Android gradle 3.0.0 - Unexpected end of ZLIB input stream

查看:131
本文介绍了Android Gradle 3.0.0-ZLIB输入流意外结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将android studio更新为3.0并切换到gradle plugin 3.0.0后,出现此错误:

After updating android studio to 3.0 and switching to gradle plugin 3.0.0 I am getting this error:

Gradle '...' project refresh failed
    Error:Unexpected end of ZLIB input stream

问题既出现在我所有的旧项目中,也出现在全新的项目中. 关于什么原因的任何想法? Gradle 2.3.3正常工作

The problems appears both in all my old projects but brand new ones as well. Any Idea on what is causing this? Gradle 2.3.3 works fine

我的项目build.gradle:

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.1.51'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

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

gradle-wrapper.properties:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

任何帮助将不胜感激!

推荐答案

我的工作室从2.3.3升级到3.0后,我遇到了同样的问题,当然,我已经将我的gradle插件版本从2.3.3升级到了3.0.

I had the same problem after my studio upgraded from 2.3.3 to 3.0, of course I have upgraded my project gradle plugin version from 2.3.3 to 3.0.

我认为gradle插件jar文件已损坏且无法读取,或者发生了任何未知的异常,因此请将其删除并重新下载.

I think the gradle plugin jar file is broken and not readable or any unknow exception happened, so delete it and re-download.

我的建议是,

  • 在工作室安装路径中删除gradle文件夹(我的文件夹为D:\ Tool \ android-studio \ gradle),
  • 重新同步您的项目.该项目将重新下载其依赖项.

如果问题没有解决,请尝试删除gradle用户数据(我的是C:\ Users \ tea \ .gradle),然后重新同步项目.

If the problem is not solved, try to delete your gradle user data (mine is C:\Users\tea\.gradle) and then re-sync project.

这篇关于Android Gradle 3.0.0-ZLIB输入流意外结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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