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

查看:22
本文介绍了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.

我的提议是,

  • 删除 studio 安装路径中的 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天全站免登陆