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

只愿长相守 提交于 2020-01-13 19:28:08

问题


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)'.

回答1:


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.



来源:https://stackoverflow.com/questions/58441409/android-studio-project-not-compiling-after-updating-firebase-perf-plugin-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!