skip to Main Content

Running Gradle task ‘assembleDebug’… e:
C:/Users/PRINCE/.gradle/caches/transforms-3/20e1315bc8f4a1bdfeb295f8a2d8ce13/transformed/jetified-play-services-measurement-api-22.1.0-api.jar!/META-INF/java.com.google.android.gmscore.integ.client.measurement_api_measurement_api.kotlin_module:
Module was compiled with an incompatible version of Kotlin. The binary
version of its metadata is 1.9.9999, expected version is 1.7.1. e:
C:/Users/PRINCE/.gradle/caches/transforms-3/539b20f16b7c8d7364edb4409aa18ddb/transformed/jetified-play-services-measurement-impl-22.1.0-api.jar!/META-INF/java.com.google.android.gms.libs.filecompliance.proto_file_access_api_type_kt_proto_lite.kotlin_module:
Module was compiled with an incompatible version of Kotlin. The binary
version of its metadata is 1.9.9999, expected version is 1.7.1. e:
C:/Users/PRINCE/.gradle/caches/transforms-3/539b20f16b7c8d7364edb4409aa18ddb/transformed/jetified-play-services-measurement-impl-22.1.0-api.jar!/META-INF/third_party.java_src.protobuf.current.java.com.google.protobuf.kotlin_only_for_use_in_proto_generated_code_its_generator_and_tests.kotlin_module:
Module was compiled with an incompatible version of Kotlin. The binary
version of its metadata is 1.9.9999, expected version is 1.7.1. e:
C:/Users/PRINCE/.gradle/caches/transforms-3/539b20f16b7c8d7364edb4409aa18ddb/transformed/jetified-play-services-measurement-impl-22.1.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.9999, expected version is 1.7.1. e:
C:/Users/PRINCE/.gradle/caches/transforms-3/d8d45bed39c0940e615784b328fea50f/transformed/jetified-kotlin-stdlib-2.0.20.jar!/META-INF/kotlin-stdlib-jdk7.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. e:
C:/Users/PRINCE/.gradle/caches/transforms-3/d8d45bed39c0940e615784b328fea50f/transformed/jetified-kotlin-stdlib-2.0.20.jar!/META-INF/kotlin-stdlib-jdk8.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. e:
C:/Users/PRINCE/.gradle/caches/transforms-3/d8d45bed39c0940e615784b328fea50f/transformed/jetified-kotlin-stdlib-2.0.20.jar!/META-INF/kotlin-stdlib.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.

BUILD FAILED in 1m 59s

┌─ 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 the                                                                                   │
│ version number of the plugin with id "org.jetbrains.kotlin.android" in the plugins block of  │
│ C:App DevloperAppsempireglassandroidsettings.gradle.                                    │
│                                                                                              │
│ Alternatively (if your project was created before Flutter 3.19), update                      │
│ C:App DevloperAppsempireglassandroidbuild.gradle                                        │
│ ext.kotlin_version = '<latest-version>'                                                      │
└──────────────────────────────────────────────────────────────────────────────────────────────┘
Error: Gradle task assembleDebug failed with exit code 1

Can someone assist me in resolving this issue that occurred following the fluter update?

2

Answers


  1. Chosen as BEST ANSWER

    after changes on android/setting.gradle

    plugins {
        id "dev.flutter.flutter-plugin-loader" version "1.0.0"
        id "com.android.application" version "8.1.4" apply false
        // START: FlutterFire Configuration
        id "com.google.gms.google-services" version "4.4.2" apply false
        // END: FlutterFire Configuration
        id "org.JetBrains.kotlin.android" version "2.0.20" apply false
    }         
    
                                                                                                                                                                                                                                               
    

    after changes on android/build.gradle

    buildscript {
    ext.kotlin_version = '2.0.20'
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:7.3.1"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.4.2'
    }} 
    

    Show this error

    FAILURE: Build failed with an exception.
    
    * Where:
    Build file 'C:App DevloperAppsempireglassandroidappbuild.gradle' line: 2
    
    * What went wrong:
    An exception occurred applying plugin request [id: 'com.android.application']
    > Failed to apply plugin 'com.android.internal.version-check'.
       > Minimum supported Gradle version is 8.0. Current version is 7.6.3. If using the gradle wrapper, try editing the distributionUrl in C:App DevloperAppsempireglassandroidgradlewrappergradle-wrapper.properties to gradle-8.0-all.zip
    

  2. If you are using or updated Flutter 3.19 or later then update the version number of the plugin with id "org.jetbrains.kotlin.android" in the plugins in your android/settings.gradle. For more information read this migration guide for older project.

    plugins {
        id "dev.flutter.flutter-plugin-loader" version "1.0.0"
        id "com.android.application" version "8.1.0" apply false
        id "org.jetbrains.kotlin.android" version "2.0.20" apply false //Your preferred Kotlin Version
    }
    

    If you have created your project before Flutter 3.19 then update ext.kotlin_version = '<latest-version>' in your android/build.gradle.

    buildscript {
        ext.kotlin_version = '2.0.20' //Your preferred Kotlin Version
        repositories {
            google()
            mavenCentral()
        }
    
        dependencies {
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        }
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search