I was getting this exact same error. I ran the command
./gradlew assembleDebug --info
Where “assembleDebug” was replaced with the assemble task for a debug version of the flavor I wanted.
Look for output
Successfully started process ‘command ‘/usr/local/opt/android-sdk/build-tools/21.1.2/aapt”
Right below that was an error describing a resource which I used in a layout file but which was missing from the dimensions files. Fixing this fixed the build issue.