[英]Android Gradle build fails from cached files
I am trying to build one of my android libraries and everytime I get the following:我正在尝试构建我的 android 库之一,每次我得到以下信息:
> Task :app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Multiple build operations failed.
java.nio.file.NoSuchFileException: /Users/user/.gradle/caches/transforms-3/0d92c5dbe3682b4fd3af323bb8f4fc81/results.bin
java.nio.file.NoSuchFileException: /Users/user/.gradle/caches/transforms-3/c9e81cc37c2c0c47883b955549c67149/results.bin
java.nio.file.NoSuchFileException: /Users/user/.gradle/caches/transforms-3/a60e256c2ccb687ca2c3dc1173bab875/results.bin
java.nio.file.NoSuchFileException: /Users/user/.gradle/caches/transforms-3/a31caec1a4d16ac05a41b0f552f96191/results.bin
java.nio.file.NoSuchFileException: /Users/user/.gradle/caches/transforms-3/9d3aed6b3e5d40e0d4373af6f3e198dc/results.bin
java.nio.file.NoSuchFileException: /Users/user/.gradle/caches/transforms-3/f9c01a9d9c0a59b69c3974ffcd3c9cee/results.bin
java.nio.file.NoSuchFileException: /Users/user/.gradle/caches/transforms-3/4d9724e0450bfaa483db25a04db0eb48/results.bin
java.nio.file.NoSuchFileException: /Users/user/.gradle/caches/transforms-3/a79286d8497b8365dabe35ac25780fe4/results.bin
java.nio.file.NoSuchFileException: /Users/user/.gradle/caches/transforms-3/2896cf3b957b3724a2dcfcee68be211f/results.bin
java.nio.file.NoSuchFileException: /Users/user/.gradle/caches/transforms-3/2896cf3b957b3724a2dcfcee68be211f/results.bin
with about 200 more lines of the same大约有 200 多行相同的行
I've tried Invalidate Cache and Restart
from android studio and I've tried rm -rf ~/.gradle/caches
but I continue getting the same error.我已经尝试过从 android 工作室使
Invalidate Cache and Restart
,并且我已经尝试过rm -rf ~/.gradle/caches
但我继续遇到同样的错误。 I am able to build the exact same library on my other computers - I just can't get it to work on one machine in particular.我能够在我的其他计算机上构建完全相同的库 - 我只是无法让它在特别是一台机器上工作。 Is there any other thing I might be missing that could cause this?
还有其他我可能会丢失的东西会导致这种情况吗?
Better to use:更好地使用:
(Mac OS): (苹果系统):
./gradlew cleanBuildCache
Windows: Windows:
gradlew cleanBuildCache
Okay so I finally managed to get it to work...好的,所以我终于设法让它工作了......
Had to run rm -rf ~/.gradle
instead of just rm -rf ~/.gradle/caches
which I guess forced it to reinstall all the gradle things and then the build worked必须运行
rm -rf ~/.gradle
而不是rm -rf ~/.gradle/caches
我猜这迫使它重新安装所有 gradle 东西然后构建工作
There's no need to delete the whole ~/.gradle
directory.无需删除整个
~/.gradle
目录。 Killing the Gradle daemon before clearing ~/.gradle/caches
worked for me.在清除
~/.gradle/caches
之前杀死 Gradle 守护进程对我有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.