非法的类文件:类module-info缺少超级类型.类文件版本53 [英] Illegal class file: Class module-info is missing a super type. Class file version 53
问题描述
当我将firebase perf依赖项添加到我的项目中时,出现此错误Illegal class file: Class module-info is missing a super type. Class file version 53.
我的Gradle和Google Services项目级别的依赖项是
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'
,我按照他们的文档 https://中提到的确切步骤进行操作firebase.google.com/docs/perf-mon/get-started-android .
我尝试清理并重建并清除Android Studio缓存.
I have tried clean and rebuild and clearing the Android Studio cache.
并且还尝试了类似的来自StackOverflow的问题解决方法
And also tried similarly issue resolution from StackOverflow
项目级构建gradle
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()
}
}
应用程序级别构建gradle
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'
}
推荐答案
将其添加到应用程序级build.gradle
文件中可暂时解决问题
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
}
}
这篇关于非法的类文件:类module-info缺少超级类型.类文件版本53的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!