I am trying to make a flutter app, which upon entering mobile number sends and otp verfication code, using firebase authentication but later an error showed up:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable".
Resolved it by doing this "dependencies{
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.22"))
//..
}"
Then another error showed up : "e: C:/Users/dhruv/.gradle/caches/transforms-3/f495eaf6341c52f3f63244e9b688886b/transformed/jetified-recaptcha-18.4.0-api.jar!/META-INF/third_party.java_src.protobuf.current.java.com.google.protobuf.kotlin_shared_runtime.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 46s
┌─ Flutter Fix ──────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a newer version of the Kotlin Gradle plugin. │
│ Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then │
│ update C:DHRUVtest_assignmentandroidbuild.gradle: │
│ ext.kotlin_version = '<latest-version>' │
└────────────────────────────────────────────────────────────────────────────────────────────┘
Error: Gradle task assembleDebug failed with exit code 1
I have tried doing this :
buildscript {
ext.kotlin_version = "1.9.0"
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.1.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// Other dependencies
}
}
but the error still isn’t solved and the line :classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
is showing a warning that “Kotlin version that is used for building with Gradle (1.9.0) is not properly supported in the IDE plugin (1.8)”. I have tried syncing as well but it’s still not working. PLs guys help me out here!!!????
dhr7v is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.