flutter报错‘/Users/xxx/.gradle/caches/journal-1/file-access.bin‘.

更新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 {} +
相关推荐
AiFlutter36 分钟前
Flutter通过 Coap发送组播
flutter
嘟嘟叽1 天前
初学 flutter 环境变量配置
flutter
iFlyCai1 天前
深入理解Flutter生命周期函数之StatefulWidget(一)
flutter·生命周期·dart·statefulwidget
sunly_1 天前
Flutter:photo_view图片预览功能
android·javascript·flutter
Summer不秃1 天前
Flutter中sqflite的使用案例
flutter
sunly_1 天前
Flutter:TweenAnimationBuilder自定义隐式动画
flutter
AiFlutter1 天前
Flutter-Web首次加载时添加动画
前端·flutter
Allen Su2 天前
【Flutter 问题系列第 84 篇】如何清除指定网络图片的缓存
flutter·缓存·如何清除指定网络图片的缓存·网络图片缓存
sunly_2 天前
Flutter:key的作用原理(LocalKey ,GlobalKey)
开发语言·javascript·flutter
AiFlutter2 天前
Flutter-flutter_blue_plus打包后无法进行设备扫描
flutter