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
Finally, I solved it modifiying these attributes on the module gradle file