48
votes

I have a Gradle file that runs the tests. It does not build anything. All it has is a unzip task that extracts all jars in a Gradle configuration into a particular directory and then runs the task of type Test. This test task points the testClasses directory to the location where the previous copy task has extracted the configuration into.

My build fails with the error message:

Problems reading data from Binary store

When I run 'gradle dependencies' it does not show any error/warning When I run the copy task individually, it runs very well fine. Only when I run everything it fails with error :

> Could not resolve all dependencies for configuration ':testConfig'.$
   > Problems reading data from Binary store in /tmp/gradle8793563212642185736.bin (exist: false)$

I see the file /tmp/gradle8793563212642185736.bin does not exist. What could be the reason for this?

8
I suddenly started seeing this behavior this morning; the build was working fine Friday. I'm using Gradle 3.2. - Jamie Bisotti
Can you perhaps provide a minimal reproducible example? - Chriki
Can you please provide the gradle file in question - kaushik
It was with gradle 2.x; I do not have a reproducible environment now. Not seeing this issue anymore with gradle 3.x - Sundeep Gupta
Is there any satisfying answer to this issue? - Akif

8 Answers

3
votes

In my case setting org.gradle.parallel=false flag fixes the issue, but it's not a solution for my project, flag increase CI build time from ~15min to ~45min.

2
votes

I was working with version 5.x earlier and then I upgraded to 6.0.1 and it resolved the issue. this is how you can upgrade

cd android
./gradlew clean
./gradlew wrapper --gradle-version 6.0.1
./gradlew -v   # to download the new version
cd ..
flutter clean
flutter run   # might take 15 - 20mins for the first time
1
votes

It happened with Flutter development in my case. Apparently, it is not an actual issue and there is no magic fix. Cleaning build file with "Flutter clean" and restarting the command line executer window solved the issue.

1
votes

This solution worked in my flutter project. I solved it by making these changes:

  1. In android level build.gradle file, replace classpath 'com.android.tools.build:gradle:3.5.4' with classpath 'com.android.tools.build:gradle:4.0.1' (basically upgrade the version from 3.5.4 to 4.0.1)
  2. In gradle-wrapper.properties file, replace distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip with distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip (upgrade from 5.6.2 to 6.1.1)

and if you have added classpath 'com.google.gms:google-services:4.3.3' to android level build.gradle file, replace that too with classpath 'com.google.gms:google-services:4.3.5' (upgrade from 4.3.3 to 4.3.5)

0
votes

Start by upgrading Gradle to the latest version.

Binary store issues reported to GitHub are often fixed right away, especially if they include a Minimal, Reproducible Example.

If upgrading didn't work, it can be useful to run the task again with Performance options disabled:

  • --no-parallel
  • --no-configure-on-demand

Next please find an existing issue or open a new one so it can be fixed in future versions. These things are all helpful:

  • Minimal, Reproducible Example
  • Build Scan
  • Smallest change that introduced the problem (e.g. worked on 5.5, but not 5.6)
0
votes

There are mainly a few steps to solve this problem.

  1. Go to gradle.properties and set org.gradle.parallel=false and sync. Make sure your sync gradle offline option is off
  2. Start the build with this option. If it's a big project setting org.gradle.parallel=false will take a long time.
  3. Cancel the build repeat the steps setting org.gradle.parallel=true.

Also do not turn on offline build

0
votes

Turns out it was just a network problem for me. Gradle just needed to connect to the internet.

0
votes

I solved upgrading following packages to last version (06/02/2021), so:
project app-level build.gradle file:

com.google.firebase:firebase-analytics:17.2.2 

to

com.google.firebase:firebase-analytics:18.0.2

Project-level build.gradle file:

com.google.gms:google-services:4.3.3 

to

com.google.gms:google-services:4.3.5