Update: It's caused by FirebaseAdMob, the compilation works if I remove the reference to the library (it was working until I updated all the recommended in the SDK Manager), I've also increased the timeout (120 sec.), and now this is the message:
java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.zip.InflaterInputStream.<init>(InflaterInputStream.java:88)
at java.util.zip.ZipFile$ZipFileInflaterInputStream.<init>(ZipFile.java:408)
at java.util.zip.ZipFile.getInputStream(ZipFile.java:389)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:270)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:756)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:650)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:315)
at com.android.dx.command.dexer.Main.runDx(Main.java:293)
at com.android.dx.command.dexer.Main.main(Main.java:249)
at com.android.dx.command.Main.main(Main.java:94)
*** Legacy debugger is deprecated. ***
It is recommended to switch to the default debugger (Tools - IDE Options).