发布于 3年前

Android Studio 报错 Unexpected end of ZLIB input stream at com.google.common.io.ByteStreams.copy

Android Studio之前没有任何错误,现在打开项目报错:
Unexpected end of ZLIB input stream at com.google.common.io.ByteStreams.copy

网上收了一些答案,有重新安装Android Studio、重新安装Gradle及其他依赖插件,还有的说是Buffer的大小不匹配造成的,我试过了都没效果。直到在国外网站看到这样一句:I had this problem and it was because i wasn't correctly closing my output streams.-- 恍然大悟! 于是删除outputs文件夹

distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
//classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.0.1'

升级插件后报错:Error:All flavors must now belong to a named flavor dimension
在defaultConfig{}中添加:

flavorDimensions ""
©2020 edoou.com   京ICP备16001874号-3