【解决】Android Gradle Sync 报错 Could not read workspace metadata

异常信息

复制代码
Caused by: java.io.UncheckedIOException:
 Could not read workspace metadata from C:\Users\xxx\.gradle\caches\transforms-4\69955912123c68eecd096b71c66ee211\metadata.bin

异常原因

看字面意思是不能读取metadata文件,原因可能是因为缓存目录异常,再有可能是读取权限异常。

解决方法

1、尝试Build->Clean Project,之前有构建成功的话,可能会有Clean Project

2、如果没有Clean Project或者Clean后依然没有解决,那么就需要删掉C:\Users\xxx\.gradle\caches下的文件,删除后下次Sync会重新拉取远程依赖,所以同步时会比较慢。

相关推荐
Just_Paranoid几秒前
【Android UI】Android Drawable XML 标签解析
android·ui·vector·drawable·shape·selector
都是蠢货6 分钟前
mysql中null是什么意思?
android·数据库·mysql
Just_Paranoid11 分钟前
【Android UI】Android 创建渐变背景 Drawable
android·ui·drawable·shape·gradient
千里马学框架13 分钟前
AI豆包手机权限文章补充:Mainfest中某个权限的protectionLevel具体是如何被系统定义的?
android·智能手机·framework·权限·protectionlevel
鹏多多16 分钟前
flutter使用package_info_plus库获取应用信息的教程
android·前端·flutter
走在路上的菜鸟24 分钟前
Android学Dart学习笔记第十五节 类
android·笔记·学习·flutter
2501_9160088926 分钟前
IOScer 证书到底是什么和怎么使用的完整说明
android·ios·小程序·https·uni-app·iphone·webview
00后程序员张40 分钟前
iOS 抓包工具实战指南,从代理到数据流,全流程工具分工解析
android·ios·小程序·https·uni-app·iphone·webview
TheNextByte11 小时前
如何将Android短信导出到CSV/TEXT/Excel
android·excel