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

ความคิดเห็น • 25

  • @codewithbenji
    @codewithbenji  3 หลายเดือนก่อน +2

    please if u get any issue with solving this please contact me on X we solve this together
    𝕏 : twitter.com/Code_with_Benji

  •  18 วันที่ผ่านมา +1

    stucking white screen on production that uploded play store. Specially When I use GetX

    • @codewithbenji
      @codewithbenji  11 วันที่ผ่านมา

      really that not good

  • @bugrahankaramollaoglu
    @bugrahankaramollaoglu 2 หลายเดือนก่อน +2

    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?

  • @keremduman8537
    @keremduman8537 4 หลายเดือนก่อน +1

    I'm getting the same error when buying build apk. I couldn't figure it out. Did you solve this?

    • @codewithbenji
      @codewithbenji  4 หลายเดือนก่อน +1

      Really this exact error on building?
      Maybe try flutter clean and rebuild again

    • @keremduman8537
      @keremduman8537 4 หลายเดือนก่อน +1

      @@codewithbenji no sir doesnt work

    • @codewithbenji
      @codewithbenji  3 หลายเดือนก่อน

      get me on
      𝕏 : twitter.com/Code_with_Benji
      if you still have this issue

  • @leonc1036
    @leonc1036 5 หลายเดือนก่อน +1

    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.

    • @codewithbenji
      @codewithbenji  5 หลายเดือนก่อน

      can u please share a small code snippet of that build.gradel file

    • @leonc1036
      @leonc1036 5 หลายเดือนก่อน

      @@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.

    • @Itjones12357
      @Itjones12357 5 หลายเดือนก่อน +2

      @@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
      }

    • @Itjones12357
      @Itjones12357 5 หลายเดือนก่อน +1

      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)

    • @codewithbenji
      @codewithbenji  3 หลายเดือนก่อน

      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
      }

  • @RohitGupta-ps1tf
    @RohitGupta-ps1tf 4 หลายเดือนก่อน +1

    i don't know why but mine is not working

    • @RohitGupta-ps1tf
      @RohitGupta-ps1tf 4 หลายเดือนก่อน +1

      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
      }

    • @codewithbenji
      @codewithbenji  4 หลายเดือนก่อน

      really ...
      run flutter clean on yo project directory terminal
      then after re-run the project make sure you have a good internet connection

    • @RohitGupta-ps1tf
      @RohitGupta-ps1tf 4 หลายเดือนก่อน

      @@codewithbenji i tried flutter clean also, but nothing happens same error

    • @RohitGupta-ps1tf
      @RohitGupta-ps1tf 4 หลายเดือนก่อน

      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
      }

    • @RohitGupta-ps1tf
      @RohitGupta-ps1tf 4 หลายเดือนก่อน

      @@codewithbenji did u check the code which i send you ?