2

My gradle build in android Studio is failing because it can't access the cache.properties file. I have tried invalidating all caches and retrying but that did not work. I also reinstalled all the SDK tools. Here is the error I'm getting

Error:java.io.FileNotFoundException: C:\Users\Siddharth\AndroidStudioProjects\IntentAssignment.gradle\2.4\taskArtifacts\cache.properties (The system cannot find the file specified) C:\Users\Siddharth\AndroidStudioProjects\IntentAssignment.gradle\2.4\taskArtifacts\cache.properties (The system cannot find the file specified) Blockquote

Any advice on what to do, here is the complete console output:

FAILURE: Build failed with an exception. * What went wrong: java.io.FileNotFoundException: C:\Users\Siddharth\AndroidStudioProjects\IntentAssignment.gradle\2.4\taskArtifacts\cache.properties (The system cannot find the file specified) C:\Users\Siddharth\AndroidStudioProjects\IntentAssignment.gradle\2.4\taskArtifacts\cache.properties (The system cannot find the file specified) * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 0.747 secs

user3131493
  • 53
  • 1
  • 7

4 Answers4

4

delete gradle folder, quit Android Studio and Start again fixed this problem for me

Zaartha
  • 1,106
  • 9
  • 25
0

run cmd write %temp% then temp folder open delete all file in temp then rebuild your project hope this will solve your problem

Satyavrat
  • 469
  • 1
  • 7
  • 24
0

After Search i found this answer and worked for me

thanks to @Salam El-Banna and @Naveed Ahmad

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:\Users\user.gradle\caches\2.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:\Users\user.gradle\caches\2.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.

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

reference: Cache.properties (The system cannot find the file specified)

mahmoud zaher
  • 544
  • 6
  • 9
0
  1. Delete your Gradle folder
  2. Invalidate cache and Restart

Simply these steps fix your issue.