Rahul Suresh
Rahul Suresh

Reputation: 184

Error:Execution failed for task ':app:mockableAndroidJar'. > java.nio.file.NoSuchFileException: C\path\.android\.android\build-cache

Error:Execution failed for task ':app:mockableAndroidJar'. java.nio.file.NoSuchFileException: C\users\Rahul.android.android\build-cache

I have tried searching a lot to get this error fixed. Even reinstalled Android Studio in a different drive, but doesn't help. Any idea how to get this fixed?

Note - This happens even when I create a new project and try compiling it.

Things I have tried :
1) Cleaning Project
2) Invalidating Caches and restarting
3) Uninstalling and reinstalling Android Studio in a different drive

Upvotes: 3

Views: 5584

Answers (4)

Muhammad Saqib Javed
Muhammad Saqib Javed

Reputation: 303

Simply update your classpath for build and google play!

   classpath 'com.google.gms:google-services:4.3.3'

   classpath 'com.android.tools.build:gradle:3.5.3'

Upvotes: 0

Rishu
Rishu

Reputation: 93

The .android file can be by default modified,created by the administrator, so right-click on the .android folder and then go to properties and set the permission for other users as well.

Upvotes: 0

Rahul Suresh
Rahul Suresh

Reputation: 184

Add android.enableBuildCache=false to gradle.properties file and that should fix this error.

Upvotes: 8

Basil jose
Basil jose

Reputation: 779

Go to File -> Settings -> Build, Execution, Deployment -> Compiler
Add to "Command-line Options":
-x :app:prepareReleaseUnitTestDependencies -x :app:mockableAndroidJar -x :app:compileReleaseUnitTestSources
Press "OK" and try to Rebuild Project again

have you tried above method ?

refer https://github.com/anggrayudi/android-hidden-api/issues/21

Upvotes: 0

Related Questions