Point kotlin message in gradle_errors.dart towards new place where templates define the kotlin version (#145936)
Fixes https://github.com/flutter/flutter/issues/144454 For reference, after formatting it looks like: ``` ââ 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 â â /Users/mackall/development/BugTesting/ELIMINATEME/blah/android/settings.gradle. â â â â Alternatively (if your project was created before Flutter 3.19), update â â /Users/mackall/development/BugTesting/ELIMINATEME/blah/android/build.gradle â â ext.kotlin_version = '<latest-version>' â ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ ```
This commit is contained in:
@@ -441,10 +441,17 @@ final GradleHandledError incompatibleKotlinVersionHandler = GradleHandledError(
|
||||
final File gradleFile = project.directory
|
||||
.childDirectory('android')
|
||||
.childFile('build.gradle');
|
||||
final File settingsFile = project.directory
|
||||
.childDirectory('android')
|
||||
.childFile('settings.gradle');
|
||||
globals.printBox(
|
||||
'${globals.logger.terminal.warningMark} Your project requires a newer version of the Kotlin Gradle plugin.\n'
|
||||
'Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then update ${gradleFile.path}:\n'
|
||||
"ext.kotlin_version = '<latest-version>'",
|
||||
'Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then update the \n'
|
||||
'version number of the plugin with id "org.jetbrains.kotlin.android" in the plugins block of \n'
|
||||
'${settingsFile.path}.\n\n'
|
||||
'Alternatively (if your project was created before Flutter 3.19), update \n'
|
||||
'${gradleFile.path}\n'
|
||||
"ext.kotlin_version = '<latest-version>'",
|
||||
title: _boxTitle,
|
||||
);
|
||||
return GradleBuildStatus.exit;
|
||||
|
||||
@@ -814,13 +814,18 @@ Execution failed for task ':app:generateDebugFeatureTransitiveDeps'.
|
||||
expect(
|
||||
testLogger.statusText,
|
||||
contains(
|
||||
'\n'
|
||||
'┌─ Flutter Fix ──────────────────────────────────────────────────────────────────────────────┐\n'
|
||||
'│ [!] Your project requires a newer version of the Kotlin Gradle plugin. │\n'
|
||||
'│ Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then │\n'
|
||||
'│ update /android/build.gradle: │\n'
|
||||
"│ ext.kotlin_version = '<latest-version>' │\n"
|
||||
'└────────────────────────────────────────────────────────────────────────────────────────────┘\n'
|
||||
'\n'
|
||||
'┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────────────┐\n'
|
||||
'│ [!] Your project requires a newer version of the Kotlin Gradle plugin. │\n'
|
||||
'│ Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then │\n'
|
||||
'│ update the │\n'
|
||||
'│ version number of the plugin with id "org.jetbrains.kotlin.android" in the plugins block of │\n'
|
||||
'│ /android/settings.gradle. │\n'
|
||||
'│ │\n'
|
||||
'│ Alternatively (if your project was created before Flutter 3.19), update │\n'
|
||||
'│ /android/build.gradle │\n'
|
||||
"│ ext.kotlin_version = '<latest-version>' │\n"
|
||||
'└──────────────────────────────────────────────────────────────────────────────────────────────┘\n'
|
||||
)
|
||||
);
|
||||
}, overrides: <Type, Generator>{
|
||||
|
||||
Reference in New Issue
Block a user