Error in Android Studio cache.properties

2019-07-11 00:40发布

Error:java.io.FileNotFoundException: C:\Users\Petrusic\AndroidStudioProjects\askramarnovi.gradle\2.2.1\taskArtifacts\cache.properties (The system cannot find the file specified)

C:\Users\Petrusic\AndroidStudioProjects\askramarnovi.gradle\2.2.1\taskArtifacts\cache.properties (The system cannot find the file specified)

8条回答
你好瞎i
2楼-- · 2019-07-11 01:20

First copy the scripts folder (Which is shown in the studio) C:\Users\[User name]\.gradle\caches\2.10\scripts to some other place

then Delete all cache.properties.lock files from your C:\Users\[User name]\.gradle\caches\2.10\scripts (Which file is shown in studio)

For every deletion Rebuild Project (Build -> Rebuild Project) if the studio showing the error in other properties.lock file means delete those all and rebuild project

After this you may get error like No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'

then include

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.1'
}

and synch (This option is at top of the build.graddle)

查看更多
做个烂人
3楼-- · 2019-07-11 01:23

Look for a cache.properties.lock file, delete it and rebuild project

查看更多
4楼-- · 2019-07-11 01:24

It is very simple just goto file > invalidiate caches/restart > pop-up will open then click on "invalidiate and restart" button

查看更多
爷、活的狠高调
5楼-- · 2019-07-11 01:25
  1. Delete yourproject/.gradle directory
  2. goto File in the menu bar and say Invalidate Cache and Restart it will be all right..
查看更多
趁早两清
6楼-- · 2019-07-11 01:28

There is probably something wrong with your cached dependencies:

Try to rebuild your project:

gradle clean build --refresh-dependencies
查看更多
狗以群分
7楼-- · 2019-07-11 01:30

I've already tried simply to delete gradle folder. then restarted Android Studio and the problem solved

查看更多
登录 后发表回答