Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

android studio gradle refresh failed (The system cannot find the file specified)

Error:Could not open initscript class cache for initialization script 'C:UsersSubashAppDataLocalTempasLocalRepo2.gradle' (C:UsersSubash.gradlecaches2.2.1scriptsasLocalRepo2_cd0g6mnzdabuvxgeqlhhrxv0qInitScriptinitscript). java.io.FileNotFoundException: C:UsersSubash.gradlecaches2.2.1scriptsasLocalRepo2_cd0g6mnzdabuvxgeqlhhrxv0qInitScriptinitscriptcache.properties (The system cannot find the file specified)

See Question&Answers more detail:os

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

1 Answer

0 votes
by (71.8m points)

UPDATE: Check my answer here for full details

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.4

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

3-Delete this folder "scripts" from the directory C:Usersuser.gradlecaches2.4

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

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...