简体   繁体   English

Gradle构建失败 - 无法解压缩

[英]Gradle build failed - unable to unzip

I am doing a project using android studio.Recently it showed an error that your SDK is missing or out of date so, I downloaded SDK once again.Now it shows an error that Gradle Build failed 我正在使用android studio做一个项目。最近它显示了一个错误, your SDK is missing or out of date所以,我再次下载SDK。现在它显示Gradle Build failed的错误

The error is mentioned below: 错误如下:

`Error:Execution failed for task ':app:prepareComAndroidSupportAnimatedVectorDrawable2531Library'.
> Unable to unzip '/home/nandha/Android/Sdk/extras/android/m2repository/com/android/support/animated-vector-drawable/25.3.1/animated-vector-drawable-25.3.1.aar' to '/home/nandha/.android/build-cache/e07f150905e44f35b3635185e8f46be2d475fc86/output' or find the cached output '/home/nandha/.android/build-cache/e07f150905e44f35b3635185e8f46be2d475fc86/output' using the build cache at '/home/nandha/.android/build-cache'.
  To troubleshoot the issue or learn how to disable the build cache, go to https://d.android.com/r/tools/build-cache.html.
  If you are unable to fix the issue, please file a bug at https://d.android.com/studio/report-bugs.html.

Kindly help me to fix this error. 请帮我修复此错误。

You need the clear the build cache. 您需要清除构建缓存。 Select View > Tool Windows > Terminal from the menu bar and use one of the following commands: 从菜单栏中选择View> Tool Windows> Terminal,然后使用以下命令之一:

On Windows: gradlew cleanBuildCache 在Windows上:gradlew cleanBuildCache

I had the same problem, The answer is there : https://developer.android.com/studio/build/build-cache.html?utm_source=android-studio#clear_the_build_cache 我有同样的问题,答案是: https//developer.android.com/studio/build/build-cache.html?utm_source = android-studio #clear_the_build_cache

You have just to do in a Terminal (for have terminal : Select View > Tool Windows > Terminal) : 您只需在终端中进行操作(对于终端:选择查看>工具窗口>终端):

On Windows: 在Windows上:

gradlew cleanBuildCache

On Mac or Linux: 在Mac或Linux上:

./gradlew cleanBuildCache

And build Gradle 并构建Gradle

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM