更新AndroidStuido Ladybug | 2024.2.1 Canary 8后 gradle一直报lock,无法编译
bash
used by: org.gradle.cache.internal.btree.CorruptedCacheException: Corrupted IndexBlock 254946 found in cache '/Users/xxx/.gradle/caches/journal-1/file-access.bin'.
at org.gradle.cache.internal.btree.FileBackedBlockStore$BlockImpl.blockCorruptedException(FileBackedBlockStore.java:267)
at org.gradle.cache.internal.btree.FileBackedBlockStore$BlockImpl.read(FileBackedBlockStore.java:236)
at org.gradle.cache.internal.btree.FileBackedBlockStore.read(FileBackedBlockStore.java:123)
at org.gradle.cache.internal.btree.CachingBlockStore.read(CachingBlockStore.java:100)
at org.gradle.cache.internal.btree.FreeListBlockStore.read(FreeListBlockStore.java:86)
at org.gradle.cache.internal.btree.StateCheckBlockStore.read(StateCheckBlockStore.java:67)
at org.gradle.cache.internal.btree.BTreePersistentIndexedCache.load(BTreePersistentIndexedCache.java:182)
at org.gradle.cache.internal.btree.BTreePersistentIndexedCache.access$1200(BTreePersistentIndexedCache.java:50)
at org.gradle.cache.internal.btree.BTreePersistentIndexedCache$IndexBlock.find(BTreePersistentIndexedCache.java:496)
at org.gradle.cache.internal.btree.BTreePersistentIndexedCache$IndexBlock.access$600(BTreePersistentIndexedCache.java:366)
at org.gradle.cache.internal.btree.BTreePersistentIndexedCache.put(BTreePersistentIndexedCache.java:144)
解决办法 删除全部lock,在终端执行下面命令, /Users/xxx/ 改成你的gradle cache路径
bash
find /Users/xxx/.gradle/caches/ -name "*.lock" -type f -exec rm -f {} +