Gradle Sync Failed: Setup Project Failed: Null

As mentioned and analyzed in the Google bug tracking issue https://issuetracker.google.com/issues/118342198

The issue was produced by configuring and adding a gradle constants file within a library sub project. That means:

This gradle dependency file was integrated in the top-level gradle file

appProject/someLibrary/some_constants.gradle

at

appProject/build.gradle

by

apply from: "someLibrary/some_constants.gradle"

Removing this line fixed the sync issue.

The overall solution was to move the some_constants.gradle file to the top level folder and just import it there directly.

apply from: "some_constants.gradle"

The interesting part: This sync issue just occurred if there was ONLY a library module within the project. As soon as an app module was also present this issue didn't occur anymore.