Недопустимый файл класса: в классе module-info отсутствует супертип. Версия файла класса 53 - PullRequest
2 голосов
/ 14 октября 2019

Когда я добавляю в свой проект зависимости firebase perf, я получаю эту ошибку Illegal class file: Class module-info is missing a super type. Class file version 53. Мои зависимости уровня проекта Gradle и Google Services равны

    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.

А также попытался аналогичным образом решить проблему с помощью StackOverflow

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

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

1 Ответ

1 голос
/ 21 октября 2019

Добавление этого в файл уровня приложения 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
          }
        }
...