If I run gradle assembleDebug from the command line, I am suddenly getting this error:
gradle assembleDebug
UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dx.util.DexEx
I had the same problem, and my solution is changing the support version '27.+'(27.1.0) to '27.0.1'