Eldhopj
Eldhopj

Reputation: 3579

Illegal class file: Class module-info is missing a super type. Class file version 53

When I add firebase perf dependency into my project i am getting this error Illegal class file: Class module-info is missing a super type. Class file version 53. My Gradle and google services project-level dependencies are

    classpath 'com.android.tools.build:gradle:3.5.1'
    classpath 'com.google.gms:google-services:4.3.2'

and I followed the exact steps mentioned in their docs https://firebase.google.com/docs/perf-mon/get-started-android.

I have tried clean and rebuild and clearing the Android Studio cache.

And also tried similarly issue resolution from StackOverflow

Project level build gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.google.com' }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.1'
        classpath 'com.google.gms:google-services:4.3.2'
        classpath 'com.google.firebase:perf-plugin:1.3.1'  // Performance Monitoring plugin
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

App level build gradle

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
        maven { url "https://jitpack.io" }
        jcenter()

    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.31.0'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
// Apply the Performance Monitoring plugin to enable instrumentation
apply plugin: 'com.google.firebase.firebase-perf'

repositories {
    maven { url 'https://maven.fabric.io/public' }
    maven { url "https://jitpack.io" }
    maven {
        url 'https://maven.google.com'
    }

}
dependencies {
// Not added all dependencies , Just the firebase one SINCE ITS PRETTY LONG
implementation 'com.google.firebase:firebase-perf:19.0.0'
}

Upvotes: 20

Views: 11187

Answers (4)

oseiskar
oseiskar

Reputation: 3372

Also remove this from gradle.properties if you happen to have it there for any reason:

android.enableR8=false

(I got the error even with com.android.tools.build:gradle:4.1.2 if the above line was present)

Upvotes: 1

Siddhivinayak
Siddhivinayak

Reputation: 1101

Adding this to your app-level build.gradle file solves the problem temporarily

debug {
          FirebasePerformance {
            // Set this flag to 'false' to disable @AddTrace annotation processing and
            // automatic HTTP/S network request monitoring
            // for a specific build variant at compile time.
            instrumentationEnabled false
          }
        }

EDIT as per other answers and comments

Change the gradle plugin to 3.6.0 to resolve it as it has been fixed in that version

Upvotes: 30

bharath v
bharath v

Reputation: 61

On updating build Gradle from 3.5.1 to 3.6.0 fixed my issue.

Upvotes: 3

kenyee
kenyee

Reputation: 2359

FYI, this was an AGP bug...it's been fixed in AGP 3.6

Upvotes: 6

Related Questions