CorruptedCacheException: Corrupted IndexBlock 2982

2020-04-03 02:13发布

My android projects runs and my app works but I keep getting these errors. Can anyone explain what is happening and how I can solve it?

org.gradle.cache.internal.btree.CorruptedCacheException: Corrupted IndexBlock 298298 found in cache '/Users/macuser/.gradle/caches/journal-1/file-access.bin'. org.gradle.cache.internal.btree.CorruptedCacheException: Corrupted IndexBlock 272355 found in cache '/Users/macuser/.gradle/caches/journal-1/file-access.bin'.
org.gradle.cache.internal.btree.CorruptedCacheException: Corrupted IndexBlock 256346 found in cache '/Users/macuser/.gradle/caches/journal-1/file-access.bin'.
org.gradle.cache.internal.btree.CorruptedCacheException: Corrupted IndexBlock 285739 found in cache '/Users/macuser/.gradle/caches/journal-1/file-access.bin'.
org.gradle.cache.internal.btree.CorruptedCacheException: Corrupted IndexBlock 272355 found in cache '/Users/macuser/.gradle/caches/journal-1/file-access.bin'.
org.gradle.cache.internal.btree.CorruptedCacheException: Corrupted IndexBlock 298298 found in cache '/Users/macuser/.gradle/caches/journal-1/file-access.bin'.
org.gradle.cache.internal.btree.CorruptedCacheException: Corrupted IndexBlock 272355 found in cache '/Users/macuser/.gradle/caches/journal-1/file-access.bin'.
org.gradle.cache.internal.btree.CorruptedCacheException: Corrupted IndexBlock 256346 found in cache '/Users/macuser/.gradle/caches/journal-1/file-access.bin'.
org.gradle.cache.internal.btree.CorruptedCacheException: Corrupted IndexBlock 272355 found in cache '/Users/macuser/.gradle/caches/journal-1/file-access.bin'.
org.gradle.cache.internal.btree.CorruptedCacheException: Corrupted IndexBlock 256346 found in cache '/Users/macuser/.gradle/caches/journal-1/file-access.bin'.
org.gradle.cache.internal.btree.CorruptedCacheException: Corrupted IndexBlock 298298 found in cache '/Users/macuser/.gradle/caches/journal-1/file-access.bin'.
org.gradle.cache.internal.btree.CorruptedCacheException: Corrupted IndexBlock 256346 found in cache '/Users/macuser/.gradle/caches/journal-1/file-access.bin'.
org.gradle.cache.internal.btree.CorruptedCacheException: Corrupted IndexBlock 298298 found in cache '/Users/macuser/.gradle/caches/journal-1/file-access.bin'.
org.gradle.cache.internal.btree.CorruptedCacheException: Corrupted IndexBlock 238437 found in cache '/Users/macuser/.gradle/caches/journal-1/file-access.bin'.
org.gradle.cache.internal.btree.CorruptedCacheException: Corrupted IndexBlock 298298 found in cache '/Users/macuser/.gradle/caches/journal-1/file-access.bin'.

标签: android
4条回答
forever°为你锁心
2楼-- · 2020-04-03 02:25

open a terminal in android studio and type this command and rebuild your project it will 100% work

rm -R .gradle
查看更多
Viruses.
3楼-- · 2020-04-03 02:30

try this: Start with your original error message "'/Users/macuser/.gradle/caches/journal-1/file-access.bin" Shut down Android and restart your computer . Navigate to the location of the problem file.... relabel your "file-access.bin" to "file-accessOLD.bin" restart Android and run your app. Android will recreate the file and the corruption should disappear. this is what the file folder looks like after the process completes

查看更多
Anthone
4楼-- · 2020-04-03 02:37

I'm on Linux (Ubuntu 18.04) and I got this error also. I had to:

  1. go to ~/.gradle/caches/journal-1
  2. delete all the files
  3. close Android Studio

Open Android Studio and everything is fixed again. You have to restart Android Studio for the fix. it must store those files in memory or something.

查看更多
beautiful°
5楼-- · 2020-04-03 02:39

I had the same issue on a mac as well.

  1. Open your /Users/macuser/ folder
  2. Press CMD + SHIFT + . (dot/period) to view hidden folders
  3. DELETE .gradle folder
  4. Restart Android Studio

This will cause Android Studio to rebuild and re-download your .gradle folder fixing your corrupt files in the process.

NOTE* I'm looking for experienced programmers to let us know if this is safe / correct to do so! It worked for me with no errors but i'm new to this so a second opinion would be appreciated.

查看更多
登录 后发表回答