Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not open cp_init class cache for initialization script

I am new to Android Studio and I keep getting this error. I have researched and tried deleting .gradle, closing program and restarting, checking power save mode, and Cleaning and Rerunning. Any other ideas to try would be greatly appreciated. It worked perfect last night and now I am getting this error.

Error:Could not open cp_init class cache for initialization script 'C:\Users\Owner\AppData\Local\Temp\asLocalRepo6.gradle' (C:\Users\Owner.gradle\caches\2.10\scripts\asLocalRepo6_4rdykqo5vjpjfhlk1g3pwkx76\cp_init).

java.io.FileNotFoundException: C:\Users\Owner.gradle\caches\2.10\scripts\asLocalRepo6_4rdykqo5vjpjfhlk1g3pwkx76\cp_init\cache.properties (The system cannot find the file specified)

Thanks!

like image 808
Brittany Avatar asked May 03 '16 23:05

Brittany


3 Answers

Set the Build, Execution, Deployment > Build Tools > Gradle > Gradle JVM to "Use Internal JRE (java version 11-ea+123"....)

https://youtrack.jetbrains.com/issue/KT-34134

enter image description here

like image 80
VilasKolhe Avatar answered Nov 02 '22 20:11

VilasKolhe


You might also be running a too-new version of Java. Downgrading to Java 1.8 via https://adoptopenjdk.net/ fixed this issue for me.

See BUG! exception in phase 'semantic analysis'

like image 18
bobmagoo Avatar answered Nov 02 '22 20:11

bobmagoo


I had this same problem sometimes ago. This is my solution

  1. Click on File menu and
  2. Select Invalidate Cache/Restart
  3. Select Invalidate and Restart
like image 3
John Avatar answered Nov 02 '22 22:11

John