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 {} +
相关推荐
m0_7482478016 小时前
Flutter Intl包使用指南:实现国际化和本地化
前端·javascript·flutter
迷雾漫步者17 小时前
Flutter组件————PageView
flutter·跨平台·dart
迷雾漫步者1 天前
Flutter组件————FloatingActionButton
前端·flutter·dart
coder_pig1 天前
📝小记:Ubuntu 部署 Jenkins 打包 Flutter APK
flutter·ubuntu·jenkins
捡芝麻丢西瓜1 天前
flutter自学笔记5- dart 编码规范
flutter·dart
恋猫de小郭1 天前
什么?Flutter 可能会被 SwiftUI/ArkUI 化?全新的 Flutter Roadmap
flutter·ios·swiftui
sunly_2 天前
Flutter:导航,tab切换,顶部固定,列表分页滚动
开发语言·javascript·flutter
敲代码的小强2 天前
Flutter项目兼容鸿蒙Next系统
flutter·华为·harmonyos
Zh-jie3 天前
flutter 快速实现侧边栏
前端·javascript·flutter
truemi.733 天前
flutter --no-color pub get 超时解决方法
android·flutter