'CorruptedCacheException: Corrupted IndexBlock 298298 found in cache '/Users/macuser/.gradle/caches/journal-1/file-access.bin'
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'.
Solution 1:[1]
Best and Easiest Way is
- Click on android studio menu button "File"
- Click on "Invalidate Cache and Restart" Button
- A popup box will open and click on "Invalidate and Restart"
- Android Studio Invalidate Caches and Restart Again
- Boom Your Problem is Solved.
Solution 2:[2]
I'm on Linux (Ubuntu 18.04) and I got this error also. I had to:
- go to ~/.gradle/caches/journal-1
- delete all the files
- 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.
Solution 3:[3]
If you are using Windows and getting the same error try this.
- delete file-access.bin in path C:\Users(User).gradle\caches\journal-1.
- Restart android studio
- Rebuild project
Solution 4:[4]
In Windows follow these steps
- C:\Users\user .gradle\caches\journal-1 --> delete all files
- Restart Android studio.
- Rebuild your project
Happy coding !
Solution 5:[5]
Just deleted the .gradle folder inside the project folder and restarted android studio worked fine in my case.
Note: if you don't have a system-wide installation of gradle, the .gradle folder will not be able to be rebuilt after deletion. -- see comments for details.
Solution 6:[6]
Solution 7:[7]
In Windows There are two ways:
First way:
-C:\Users.gradle\caches\journal-1 Delete all the files
-Restart Android studio.
-Rebuild your project
Second way:
-Go to file click on --> Invalid Cache and Restart
Enter and finish
your Android studio will restart by it's own Rebuild the project
This will work 100%
#HappyCoding
Solution 8:[8]
In Windows There are two ways but this one worked for me.. hope it works out for you
First way:
-C:\Users.gradle\caches\journal-1 Delete all the files
-Restart Android studio.
-Rebuild your project
Solution 9:[9]
open a terminal in android studio and type this command and rebuild your project it will 100% work
rm -R .gradle
Solution 10:[10]
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mitron Messanger |
| Solution 2 | raddevus |
| Solution 3 | Kneelon |
| Solution 4 | |
| Solution 5 | |
| Solution 6 | Futurealex |
| Solution 7 | |
| Solution 8 | Geoffrey Matieso |
| Solution 9 | |
| Solution 10 | Denis |
