解决gradle /Users/xxxx/Documents/workspace/fontmanager/.gradle/2.2.1/taskArtifacts/cache.properties (No such file or directory)报错办法

git 上down下项目后,发现Android Studio报错:
What went wrong:
java.io.FileNotFoundException: /Users/raomengyang/Documents/workspace/fontmanager/.gradle/2.2.1/taskArtifacts/cache.properties (No such file or directory)
> /Users/raomengyang/Documents/workspace/fontmanager/.gradle/2.2.1/taskArtifacts/cache.properties (No such file or directory)
 
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
 
 
1.项目中local.properties 的sdk.dir=  <此处SDK路径不同需修改>
2. Google一番没找到问题解决方法,cd 到Users/raomengyang/Documents/workspace/fontmanager/.gradle/2.2.1/ 后发现没有cache.properties文件,只有一个cache.properties.lock  感觉应该是这个文件被lock上了
? / cd Users/xxxxx(Username)/Documents/workspace/fontmanager
? fontmanager git:(temp) ? ls -a
. .gradle actionbarsherlock_new gradle local.properties.bak
.. .idea build gradlew local.properties.bak~HEAD
.git FontManage build.gradle gradlew.bat settings.gradle
.gitignore SliderLib fontmanager.iml local.properties viewpagerindicator
? fontmanager git:(temp) ? cd .gradle
? .gradle git:(temp) ? ls
2.2.1
? .gradle git:(temp) ? cd 2.2.1/taskArtifacts
? taskArtifacts git:(temp) ? ls
cache.properties.lock fileHashes.bin fileSnapshots.bin outputFileStates.bin taskArtifacts.bin
? taskArtifacts git:(temp) ? cache.properties.lock

 

于是cp cache.properties.lock /Users/raomengyang/Desktop
然后把文件的读取改为everyone 读写,并去掉.lock后缀变为cache.properties
再将其cp回去,项目成功运行。

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。