Home > Software design >  Could not get unknown property 'Kotlin_version' for object of type org.gradle.api.internal
Could not get unknown property 'Kotlin_version' for object of type org.gradle.api.internal

Time:02-23

Here are the dependencies in the project file

I keep getting errors with the kotlin dependencies. It wont let me use the dependency: classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10:$Kotlin_version"

Any help would be greaty appreciated, thanks :)

Project Gradle file: enter image description here

App level gradle files: build.gradle app module file build.gradle app module second screenshot

CodePudding user response:

Based on the details you provided in the comments, it seems like there's a name mismatching. You've declared ext.kotlinversion, but are trying to access Kotlin_version.

The solution is to make the variable name match its decalaraion. So, you may change ext.kotlinversion to ext.Kotlin_version.

CodePudding user response:

You just have to remove line 10 and keep line 12

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10:$Kotlin_version"

You are already adding this classpath correctly below on line 12. Just do it and it will work fine

  • Related