更新firebase-perf插件后,Android Studio项目无法编译(缺少类module-info) [英] Android studio project not compiling after updating firebase-perf plugin (Class module-info is missing)
问题描述
每个人.我正在使用gradle版本5.6.2.我这样更新了我的android studio项目依赖项:
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"
}
我这样应用插件:
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)
它说问题出在app \ build \ intermediates \ transforms \ FirebasePerformancePlugin \ bus \ debug \ 9 \ module-info.class
It says the problem is in app\build\intermediates\transforms\FirebasePerformancePlugin\bus\debug\9\module-info.class
里面有这个:
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;
}
我的猜测是firebase开始使用Java 9,但我的项目当前正在使用Java8.我尝试将版本更改为9,但出现此错误:
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)'.
推荐答案
这是 Android Gradle中的错误插件,现已在 Android Studio 3.6 中修复.它似乎仅在Windows上是一个问题,因为路径格式使用反斜杠\
而不是正斜杠/
.我确认我可以在Linux上的Android Studio 3.5上构建我的应用程序,但不能在Windows上构建.
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.
这篇关于更新firebase-perf插件后,Android Studio项目无法编译(缺少类module-info)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!