Android studio project not compiling after updating firebase-perf plugin (Class module-info is missing)
Asked Answered
B

2

3

everyone. I'm using gradle version 5.6.2. I updated my android studio project dependencies like this:

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"
}

I apply the plugins like this:

apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'com.google.gms.google-services'

But now when I compile my project this error shows up:

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

It says the problem is in app\build\intermediates\transforms\FirebasePerformancePlugin\bus\debug\9\module-info.class

Inside there's this:

module com.google.gson {
    requires transitive java.sql;

    exports com.google.gson;
    exports com.google.gson.annotations;
    exports com.google.gson.reflect;
    exports com.google.gson.stream;
}

My guess is that firebase started using Java 9 but my project is currently working with Java 8. I tried changing the version to 9 but I get this error:

Could not target platform: 'Java SE 9' using tool chain: 'JDK 8 (1.8)'.
Broncho answered 17/10, 2019 at 22:17 Comment(0)
S
5

This is a bug in the Android Gradle plugin, fixed now in Android Studio 3.6. It looks to only be an issue on Windows, as the path format uses the backslash \ instead of forward slash /. I confirmed I am able to build my app on Android Studio 3.5 on Linux, but not Windows.

Storer answered 24/11, 2019 at 8:3 Comment(0)
S
1

It was solved temporarily by adding this to build.gradle :

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
          }
        }
Sheepshearing answered 2/11, 2020 at 9:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.