Error:Cause: invalid stream header: 000900D9 in android studio 2.3.1
I was facing the same problem and was not able to figure out what exactly causes this problem.
But removing the whole .gradle folder (/home/$USER/.gradle in my case) and rebuilding the app fixed it.
I noticed that many users (me included) faced this issue using the 3.3 gradle version; update to 3.5 and it will be fine
Go to your console, run
./gradlew --stacktrace
If it says
GradleException: Could not read cache value from '[...]/.gradle/daemon/3.3/registry.bin'
go to this folder and delete the file registry.bin.lock
. No need to delete the whole .gradle
directory and download everything again.