Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
223 views
in Technique[技术] by (71.8m points)

android - Cache.properties (The system cannot find the file specified)

I just started using Android Studio 1.3 sdk 24 and it has worked fine until today. I get this error message about cache.properties and I delete that cache file but now I am getting this error message:

Error:C:Usersuser1.gradlecaches2.4scriptsasLocalRepo15_dhjxrnvsgiyg1ow3dfj4myl7InitScriptinitscriptcache.properties (The system cannot find the file specified)

I try file/invalidate caches/restart.. and rebuild project but am still getting this error message. How do I fix it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You don't have to delete all .gradle folders and no need to reinstall Android Studio.

I have the latest version of Android Studio and I faced that problem, the only thing that worked for me is to:

  1. Navigate to C:Usersuser.gradlecaches2.x

  2. Copy the folder scripts , scripts-remapped and paste it somewhere safe just in case anything went wrong you will place it back

  3. Delete this folder scripts and scripts-remapped from the directory C:Usersuser.gradlecaches2.x

  4. Sync Project with Gradle Files and you are done.

enter image description here

When you sync your project Android Studio will generate new cache files.

You also need to delete buildOutputCleanup.lock from projectLocation/.gradle/buildOutputCleanup in case the above 4 steps do not work out.

It worked for me I hope it will work for you.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...