-1

So I'm trying to build the apk for my application using the command flutter build apk but the below error occurs every single time:

enter image description here

As of now, the latest kotlin version is 1.9.0, so I did update the version to that in my build.gradle but the error seems to be persisting.

Here is my root level build.gradle file:

buildscript {
    ext.kotlin_version = '1.9.0'
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.1.2'
        classpath 'com.google.gms:google-services:4.3.15'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}
Md. Yeasin Sheikh
  • 54,221
  • 7
  • 29
  • 56
dipansh
  • 331
  • 3
  • 15

1 Answers1

-1
  1. Change kotlin version to latest one which is available at this path android/build.gradle

    ext.kotlin_version = version <-- latest version

  2. Upgrade class path to latest one

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

  3. Change url of android/gradle/wrapper/gradle-wrapper.properties to latest like this

    https://services.gradle.org/distributions/gradle-7.5-all.zip

after following this steps you are able to solve this issue.

Divit Vaghani
  • 90
  • 1
  • 8