4

Hi I started getting error after I upgraded my Flutter version in MacOS Sequioa (15.5 (24F74)

Running Gradle task 'assembleDebug'...
e: file:///Users/.../development/flutter/packages/flutter_tools/gradle/src/main/kotlin/FlutterPlugin.kt:715:21 Unresolved reference 'fileMode'.
e: file:///Users/.../development/flutter/packages/flutter_tools/gradle/src/main/kotlin/FlutterPluginUtils.kt:67:61 'fun String.toLowerCase(): String' is deprecated. Use lowercase() instead.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':gradle:compileKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

android/build.gradle:

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

    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

rootProject.buildDir = '../build'
subprojects {
     afterEvaluate { project ->
        if (project.plugins.hasPlugin("com.android.application") ||
                project.plugins.hasPlugin("com.android.library")) {
            project.android {
                compileSdkVersion 36
                buildToolsVersion "36.0.0"
            }
        }
    }
    project.buildDir = "${rootProject.buildDir}/${project.name}"
    project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
    delete rootProject.buildDir
}

I tried solving compiler issues in both files as suggested by Dhrumil Parikh but got following issue:

Build file '/Users/../Flutter App/android/build.gradle' line: 32. This line is project.evaluationDependsOn(':app')

Flutter details:

Flutter 3.32.0 • channel stable • https://github.com/flutter/flutter.git Framework • revision be698c48a6 (3 days ago) • 2025-05-19 12:59:14 -0700 Engine • revision 1881800949 (3 days ago) • 2025-05-19 10:54:07 -0700 Tools • Dart 3.8.0 • DevTools 2.45.1

1
  • 1
    Can you also provide related gradle files? I think the versions of agp / gradle / Kotlin might be related to these errors Commented May 22 at 10:57

1 Answer 1

4

In Flutter App/android/build.gradle, use:

ext.kotlin_version = '2.1.21'

In gradle-wrapper.properties, use:

distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip

In pubspec.yaml:

Upgrade the package intl to ^0.20.2 if you are using it

and (optional) use:

flutter:  
    generate: true
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.