How to Update to the Latest Kotlin Gradle Plugin Version in Android Studio
ฝัง
- เผยแพร่เมื่อ 10 ก.ย. 2024
- Upgrading the Kotlin Gradle plugin in your Flutter projects can unlock new features and improve build performance, but the process might seem daunting at first, especially in Android Studio. This tutorial demystifies the steps needed to update the Kotlin Gradle plugin in Android Studio, tailored specifically for Flutter developers. Whether you're aiming to solve compatibility issues, leverage new Kotlin features, or simply keep your project up-to-date, this guide provides you with a straightforward path to upgrading your Kotlin Gradle plugin, ensuring your Flutter projects remain cutting-edge. Join us as we navigate the world of Flutter development in VSCode, step by step,
[!] Your project requires a newer version of the Kotlin Gradle plugin.
#Flutter, #androidstudio , #KotlinGradlePlugin, #FlutterDev, #KotlinUpdate, #FlutterProjects, #MobileDevelopment, #CodingTutorial, #techtips
Find the latest version on:👇
kotlinlang.org...
Follow & Contact Me On 👇:
𝕏 : / code_with_benji
please if u get any issue with solving this please contact me on X we solve this together
𝕏 : twitter.com/Code_with_Benji
stucking white screen on production that uploded play store. Specially When I use GetX
really that not good
with the most-updated version both build.gradles changed a lot. buildScript {} is gone, and the lines you mentioned naturally causing errors. is there any updated changes you could share in a new video or something?
yah thats true
I'm getting the same error when buying build apk. I couldn't figure it out. Did you solve this?
Really this exact error on building?
Maybe try flutter clean and rebuild again
@@codewithbenji no sir doesnt work
get me on
𝕏 : twitter.com/Code_with_Benji
if you still have this issue
How do you fix the same error using the new build.gradle syntax or format, the one without buildscript? This solution is everywhere but can't find for to the updated format. Thanks in advance.
can u please share a small code snippet of that build.gradel file
@@codewithbenji
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
By the way, I'm new to flutter/programming. Also, last month, I was able to build apk but I was not paying attention to the build.gradle because there were no errors. So I'm thinking this is new to the latest version of flutter.
I've read the doc and was stated that the old way(Buildscript) will no longer be use(this was my general understanding). I was paying attention to it because most are using this solution: edit Buildscript section by adding the kotlin version.
@@codewithbenji
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
does you find out how to rectify this error? if so pls tell me how to do?or else if you know please say how to convert our new build.gradle file into old build.gradle file(the one with buildscript)
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
i don't know why but mine is not working
this is my code snippet
buildscript {
ext.kotlin_version = '1.9.23'
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.1'
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
really ...
run flutter clean on yo project directory terminal
then after re-run the project make sure you have a good internet connection
@@codewithbenji i tried flutter clean also, but nothing happens same error
check this code and tell me if i had typed anything wrong
buildscript {
ext.kotlin_version = '1.9.23'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.google.gms:google-services:4.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
@@codewithbenji did u check the code which i send you ?