How to Update to the Latest Kotlin Gradle Plugin Version in Android Studio

Поделиться
HTML-код
  • Опубликовано: 22 ноя 2024

Комментарии • 25

  • @codewithbenji
    @codewithbenji  6 месяцев назад +2

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

  • @bugrahankaramollaoglu
    @bugrahankaramollaoglu 4 месяца назад +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?

  •  3 месяца назад +1

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

  • @leonc1036
    @leonc1036 7 месяцев назад +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  7 месяцев назад

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

    • @leonc1036
      @leonc1036 7 месяцев назад

      @@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 7 месяцев назад +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 7 месяцев назад +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  6 месяцев назад

      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
      }

  • @keremduman8537
    @keremduman8537 7 месяцев назад +1

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

    • @codewithbenji
      @codewithbenji  6 месяцев назад +1

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

    • @keremduman8537
      @keremduman8537 6 месяцев назад +1

      @@codewithbenji no sir doesnt work

    • @codewithbenji
      @codewithbenji  6 месяцев назад

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

  • @RohitGupta-ps1tf
    @RohitGupta-ps1tf 6 месяцев назад +1

    i don't know why but mine is not working

    • @RohitGupta-ps1tf
      @RohitGupta-ps1tf 6 месяцев назад +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  6 месяцев назад

      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 6 месяцев назад

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

    • @RohitGupta-ps1tf
      @RohitGupta-ps1tf 6 месяцев назад

      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 6 месяцев назад

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