Jetpack使用Firebase撰写编译错误

时间:2020-08-28 14:18:18

标签: android firebase android-studio android-jetpack-compose

我跟随Google guidlines在我的项目中设置撰写,这是我的应用级build.gradle

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'

android {
    compileSdkVersion rootProject.compileSdkVersion
    buildToolsVersion rootProject.buildToolsVersion

    defaultConfig {
        applicationId "com.super.note"
        minSdkVersion rootProject.minSdkVersion
        targetSdkVersion rootProject.targetSdkVersion
        versionCode rootProject.versionCode
        versionName rootProject.versionName

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = "1.8"
        useIR = true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    buildFeatures {
        compose true
    }

    composeOptions {
        kotlinCompilerExtensionVersion Versions.compose
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation Kotlin.stdlib
    implementation AndroidX.coreKtx
    implementation AndroidX.appcompat
    implementation AndroidX.constraintLayout
    implementation AndroidX.recyclerView
    implementation Lifecycle.extensions
    implementation Lifecycle.livedata
    implementation Material.core
    implementation AndroidX.legacySupport
    androidTestImplementation "androidx.test.ext:junit:$junit_android_version"

    //fragment androidx
    implementation AndroidX.fragment
    implementation AndroidX.fragmentKtx

    //navigation
    implementation Navigation.fragment
    implementation Navigation.uiKtx

    //Debugging
    implementation Debug.timber

    //lottie
    implementation Animation.lottie

    //Hilt DI
    implementation Di.hiltAndroid
    kapt Di.hiltCompiler
    implementation Di.hiltViewModel
    kapt Di.hiltAndroidX

    //compose
    implementation Compose.core
    implementation Compose.material
    implementation Compose.tooling

    implementation project(":domain")
    implementation project(":data")
}

尝试构建此错误消息:

e: java.lang.NoSuchMethodError: org.jetbrains.kotlin.codegen.state.GenerationState$Builder.isIrBackend(Z)Lorg/jetbrains/kotlin/codegen/state/GenerationState$Builder;

我使用Firebase,hilt和corutine并使用Android Studio 4.2 Canary构建项目。

有人有解决此问题的想法吗?或者我目前无法使用firebase和google播放corutine与compose吗?谢谢

0 个答案:

没有答案