Android Studio Gradle Error Reading ZIP-File

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 17:33:07

问题


I got some problems with my Android Studio (0.8.9). When i want to create a new project, debug it or whatever, there just appears a error message like:

Gradle 'Afsddsf' project refresh failed

Error:Cause: error reading zip file

in the top it shows:

gradle project sync failed. basic functionality will not work properly

I already have the zip-Folder in my .gradle-File. I found a lot of errors here in google about opening the zip-file. but noone of these matched to my error. I also installed all of the SDK's and so on.

Also tried to set up the gradlesettings in this project and choosed the local gradle, but also didn't work. maybe it helps to say, that also my "handyvieweremulator", which was normally shown in the beginning on the right side of the programm, won't work. he has some referending problems. i'm gonna post my errorlog this evening, if this is gonna help too.

Thanks for any help ...


回答1:


I had the same problem, here's how it solved it: (tested on Android Studio under OSX 10.10.5)

Preferences --> Build, Execution, Deployment --> Build Tools --> Gradle


Then check Offline work.
This will use your local gradle distribution and will recreate the zip file when you sync Gradle or Run the project.
Hope this helps.




回答2:


Like VVZen said that, i followed

File --> Settings --> Build, Execution, Deployment --> Build Tools --> Gradle

and i checked 'Offline work' option.

Additional, i followed below steps that;

File --> Invalidate Caches / Restart --> Invalidate and Restart.

After above steps, that problem was resolved for me.




回答3:


I think you should delete files inside the .gradle file of the project and restart the studio. as It works for me.



来源:https://stackoverflow.com/questions/26452521/android-studio-gradle-error-reading-zip-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!