By using “./gradlew assembleDebug”, we will be able to get a more meaningful error message. In my case, “./gradlew assembleDebug” show me exactly where my source code needs fixes.
Definitely, there is still some gap between Android Studio building and building with Gradle itself.