Home > Net >  Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20. in flutter
Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20. in flutter

Time:12-16

When I run flutter run I get this error:

             FAILURE: Build failed with an exception.
    
    * What went wrong:
    A problem occurred configuring project ':assets_audio_player'.
    > Could not resolve all artifacts for configuration ':assets_audio_player:classpath'.
       > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20.

enter image description here

gradle-wrapper.properties: distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip

Update app/build.gradle: enter image description here

enter image description here

enter image description here enter image description here Does anyone know how to solve it? Thanks in advanced

CodePudding user response:

Have you tried upgrading your kotlin version?

ext.kotlin_version = '1.7.20'

CodePudding user response:

Could you try to update the Gradle Wrapper to 7.6 and Kotlin to 1.7.10 (or 1.7.20) ?

https://docs.gradle.org/current/userguide/compatibility.html

Also

classpath 'com.android.tools.build:gradle:3.5.4' 

is pretty old

try

classpath  'com.android.tools.build:gradle:7.1.2'

You need to ensure that the Gradle Wrapper, Kotlin Version and all those plugins you are using or adding to your classpath, are compatible to each other otherwise you might get weird erros.

  • Related