13

Android Studio Failed to open zip file问题

 3 years ago
source link: http://www.androidchina.net/7450.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Android Studio Failed to open zip file问题 – Android开发中文站
你的位置:Android开发中文站 > Android开发 > 新手入门 > Android Studio Failed to open zip file问题

前言

在更新完studio之后,gradle 在编译更新的时候,弹出了如下的错误

Error:Failed to open zip file.
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
Re-download dependencies and sync project (requires network)

愣是谷歌和百度,说是gradle-wrapper.properties文件的问题,原因是使用了gradle-3.3-all.zip,而gradle-3.3-all.zip无法直接在studio中下载下来。尝试了好几种的解决方法,最后花费了两个小时才解决。下面列出几个比较常见的解决方案。

▲ 解决方案

1 . 可以把gradle-wrapper.properties里修改了gradle的版本,与之前没有报错的gradle版本一致,然后再修改项目build.gradle文件中的com.Android.tools.build:gradle的版本号,具体是多少也是参照以前那些没有报错的项目。

2 . 直接在网上找到gradle-3.3-all.zip下载下来,不要解压缩,放在类似下面的目录中 C:\Users\Administrator.gradle\wrapper\dists\gradle-3.3-all\55gk2rcmfc6p2dg9u9ohc3hw9,这个办法没有试过,按理说是可以的。下载地址在这里找:http://services.gradle.org/distributions/ ,里面各个版本都有。

3 . 最简单的方法,适用于windows用户和masOS用户。将文件gradle-wrapper.properties中的

distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip
改成

distributionUrl=http://services.gradle.org/distributions/gradle-3.3-all.zip

将https的s去掉即可。ps:我mac电脑的studio就是这么解决的ㄟ(▔,▔)ㄏ

转载请标明出处:http://blog.csdn.net/donkor_/article/details/77503757

转载请注明:Android开发中文站 » Android Studio Failed to open zip file问题


Recommend

  • 16
    • floooh.github.io 4 years ago
    • Cache

    Nebula3's Zip file system

    Nebula3's Zip file system Feb 18, 2007 • Andre Weissflog Game applications often use file archives to reduce file system clutter and improve performance when many small files must be opened and read by the applica...

  • 14

    Do you want to create a ZIP archive on your Windows PC? There are various reasons you would want to do this. Maybe you want to combine multiple files into a single archive? Or maybe you want to reduce the size of your files by co...

  • 15
    • khalidabuhakmeh.com 4 years ago
    • Cache

    Create A Zip File With .NET 5

    March 16, 2021 Create A Zip File With .NET 5

  • 26
    • sam.roon.io 4 years ago
    • Cache

    Download Emtee Logan Album Zip File

    Scrape Bebas Download Emtee Logan Album Zip File MP3Download Emtee Logan Album Zip File Free Download Emtee Logan Album Zip File Mp3 download. This song has been watched 54,013 times. Download Emtee - Man...

  • 9

    Compressing multiple files into a ZIP file is a great way to share them in one go. Not only does this squeeze a file down to make it easier to store or share, but you can also add a password on them so you can control who sees th...

  • 16
    • www.makeuseof.com 3 years ago
    • Cache

    How to Open ZIP Files in Android

    Thanks to the advantages the ZIP format provides, file compression is common, especially where large file sizes are involved. From time to time, you might download a ZIP file on your Android phone. To read its contents, you must...

  • 14
    • games.greggman.com 3 years ago
    • Cache

    Zip - How not to design a file format.

    Zip - How not to design a file format. 2021-01-16 The Zip file format is now 32 years old. You'd think being 32 years old the format would be well documented. Unfortunately it's not. I...

  • 13
    • www.makeuseof.com 3 years ago
    • Cache

    How to Make a ZIP File on an iPhone or iPad

    How to Make a ZIP File on an iPhone or iPad By Alvin Wanjala Published 21 hours ago Learn how to compress documents into smaller...

  • 10

    Gradle Failed to open zip file. 解决方法 2018.09.22 |

  • 11

    Append a file into a zip file in Python I was trying to find a way to append a file into a zip file in python,...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK