Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Type without superclass: module-info

With literally nothing changed since 2 days ago my app isn't building at all. transformClassesWithDesugarForDebug is failing on every single branch in the whole project. I'm suspecting some issue with Firebase or GCM but I haven't changed their versions. I'm using Android Studio 3.2 and com.android.tools.build:gradle:3.2.0.

Here is the log of the crash. Invalidating cache, clean build or similar solutions aren't working. It is even reproducible on different computers running different versions of Android Studio and Mac OS.

Exception in thread "main" java.lang.IllegalArgumentException: Type without superclass: module-info
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:191)
at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.visit(DefaultMethodClassFixer.java:80)
at org.objectweb.asm.ClassVisitor.visit(ClassVisitor.java:113)
at com.google.devtools.build.android.desugar.InterfaceDesugaring.visit(InterfaceDesugaring.java:97)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:621)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:500)
at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:477)
at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:361)
at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:314)
at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:711)
like image 904
Viktor Stojanov Avatar asked Oct 01 '18 11:10

Viktor Stojanov


1 Answers

The issue occurred because of different versions of an indirect dependency which was incompatible with its previous version. Some libraries we were using already updated to a newer version of this specific dependency, while others did not. Having them both was causing the crash.

Solution was running androidDependencies, checking where the inconsistencies occur and then forcing android to use a single version of the specific library by including it in your own dependencies.

like image 90
Viktor Stojanov Avatar answered Oct 08 '22 16:10

Viktor Stojanov