My flutter app was and is running fine. I decided to handle deep linking in my app and added uni_links, but now I can't build my apk, even though app is running fine. I don't think the error makes sense, because I changed my kotlin version to 2.1.21, but the error still complains about 2.1.0. I deleted .gradle/ as well to see if there was a caching issue.
uni_links: ^0.5.1
android/build.gradle:
buildscript {
ext.kotlin_version = '2.1.21'
repositories {
google()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
settings.gradle:
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.3.2" apply false
// START: FlutterFire Configuration
id "com.google.gms.google-services" version "4.3.15" apply false
id "com.google.firebase.crashlytics" version "2.8.1" apply false
// END: FlutterFire Configuration
id "org.jetbrains.kotlin.android" version "2.1.21" apply false
}
I updated my gradle-wrapper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
But I keep seeing this error:
was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.9.0.
:uni_links:verifyReleaseResources'. BUILD FAILED in 36s Running Gradle task 'assembleRelease'...
[!] Your project requires a newer version of the Kotlin Gradle plugin.
//idk if this matters
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
}
uni_links version 0.x is discontinued. Port your package to a later version.