每个人。我使用的是 gradle 版本 5.6.2。我更新了我的 android studio 项目依赖项,如下所示:
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'
但现在当我编译我的项目时出现此错误:
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
里面有这个:
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,但我的项目当前正在使用 Java 8。我尝试将版本更改为 9,但收到此错误:
Could not target platform: 'Java SE 9' using tool chain: 'JDK 8 (1.8)'.
This is Android Gradle 插件中的一个错误,现在固定在安卓工作室3.6。这看起来只是 Windows 上的问题,因为路径格式使用反斜杠\
而不是正斜杠/
。我确认我能够在 Linux 上的 Android Studio 3.5 上构建我的应用程序,但不能在 Windows 上构建我的应用程序。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)