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 solved similar error by adding following piece of code to my build.gradle file inside the android block.
android { dexOptions { preDexLibraries = false } }