androidfirebasekotlingradle

The binary version of its metadata is 1.7.1, expected version is 1.5.1. How to Solve?


I connected firebase and I got this error, how can I fix it? (Class 'com.google.firebase.auth.ktx.AuthKt' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.)

build.gradle

buildscript {
    ext {
        compose_version = '1.1.0-beta01'
    }

    dependencies {
        classpath 'com.google.gms:google-services:4.3.13'
    }
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    id 'com.android.application' version '7.2.1' apply false
    id 'com.android.library' version '7.2.1' apply false
    id 'org.jetbrains.kotlin.android' version '1.5.31' apply false
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Solution

  • Recently i had same issue,

    I fixed with below steps.

    Project Gradle

     classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10' 
     or 
     id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
    

    App gradle

    implementation "org.jetbrains.kotlin:kotlin-reflect:1.7.10" 
    

    You can find more details on the below thread. Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15