Flutter: Your project requires a newer version of the Kotlin Gradle plugin
build.gradle の ext.kotlin_version を最新の Kotlin リリースに更新して、Flutter の 'Your project requires a newer version of the Kotlin Gradle plugin' エラーを解消する方法を解説します。
[!] 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
<project path>\android\build.gradle:
ext.kotlin_version = '<latest-version>'
これは 2 つのシンプルなステップで解消できます。
- ステップ 1: https://kotlinlang.org/docs/releases.html#release-details にアクセスして、Kotlin の最新バージョンを確認します。私の場合は 1.9.0 でした。
- ステップ 2:
build.gradleファイル (<project path>\android\build.gradleにあります) を開きます。一番上の方 (通常は 2 行目) にext.kotlin_version = '1.6.10'のような行が見えるはずです。その行を最新の Kotlin バージョンに更新します。私の場合は次のような形になります。
buildscript {
ext.kotlin_version = '1.9.0'
[...]
Comments
Sign in with GitHub to comment. Reactions and replies thread back to the comments repo.