Viktor Stojanov
Viktor Stojanov

Reputation: 708

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)

Upvotes: 11

Views: 3595

Answers (5)

Yinlong Liu
Yinlong Liu

Reputation: 69

maybe cause: Add module-info for standard library artifacts from kotlin 1.4. see: https://youtrack.jetbrains.com/issue/KT-21266

Upvotes: 0

Assa Lahav
Assa Lahav

Reputation: 51

I had the same problem. It was solved when I upgraded Android Studio to v3.3, and gradle to the latest (5.1.1).

Upvotes: 0

Viktor Stojanov
Viktor Stojanov

Reputation: 708

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.

Upvotes: 3

Jessica Rodriguez
Jessica Rodriguez

Reputation: 2974

I think it has the same issue from github -> Using latest version with Android, results in broken build

For documentation, only way to include "classifier" in Gradle build dependencies specification is this

 dependencies {
     implementation group: 'org.joda', name: 'joda-convert', version: '2.0.1', classifier: 'classic' }

Upvotes: 0

ʍѳђઽ૯ท
ʍѳђઽ૯ท

Reputation: 16976

Try adding this in app/Build.gradle:

android {
    aaptOptions {
    cruncherEnabled = false
    }
}

Upvotes: -1

Related Questions