0

I am using Convex Bottom Navigation plugin for the Bottom Navigation Bar. My Kotlin Version is 1.8.10. There is no problem running the app directly in mobile, but while Building the APK it is throwing error.

** C:/Users/Vasanthan Raj/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.8.0/f7197e7cc76453ac59f8b0f8d5137cc600becd36/kotlin-stdlib-common-1.8.0.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.5.1.**

And Asking to Update the Kotlin version

┌─ 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 D:\GitHub\absy_flutter_application\android\build.gradle: │ │ ext.kotlin_version = '' │ └────────────────────────────────────────────────────────────────────────────────────────────┘

Vasanthan Raj
  • 126
  • 1
  • 9

1 Answers1

0

Here is how I upgraded gradle in my older Flutter project:

Create a new temp project with the latest version of Flutter. You'll use this to see what version of gradle Flutter is using nowadays.

In the temp project open android/build.gradle check the classpath version of gradle being used and update that in your old Flutter project. For me today it looks like this:

classpath 'com.android.tools.build:gradle:4.1.0'

In the temp project open android/gradle/wrapper/gradle-wrapper.properties and check the distributionUrl. Update your old project to use the same one. For me today it looks like this:

distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip

Rerun your app. It has to download the new version of gradle to the android/.gradle directory so the first time might take a while.