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
}
CodePudding user response:
Try downgrading kotlin version from 1.7.1 to 1.5.1. Your current version is causing the issue as firebase auth dependency is not compatible with your current kotlin version.
CodePudding user response:
In your project level open build.gradle
file, increase the ext.kotlin_version
from whatever current version that you have to the latest stable version 1.7.10
.
You can get latest version from here:
https://kotlinlang.org/docs/releases.html#release-details
CodePudding user response:
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