Is ```plugins { id 'org.jetbrains.kotlin:android' version "$kotlin_version" }``` alternative syn...
a
Is
Copy code
plugins {
    id 'org.jetbrains.kotlin:android' version "$kotlin_version"
}
alternative syntax for:
Copy code
apply plugin: 'kotlin-android'
? Apologies for the noob question.
m
Mostly yes.
plugins {}
will support more things like retrieving the jar from the pluginId and generating accessors but both apply the Android plugin
a
Thanks @mbonnin! I just got this however:
A problem occurred evaluating project ':app'.
> plugin id 'org.jetbrains.kotlin:android' is invalid: Plugin id contains invalid char ':' (only ASCII alphanumeric characters, '.', '_' and '-' characters are valid)
what I did is:
id 'org.jetbrains.kotlin:android' version "$kotlin_version"
m
Oops yep, my bad
"org.jetbrains.kotlin.android"
is what you want
a
is it a typo?
👀 1
m
A jar file (with the colon) can contain multiple pluginIds (without the colon)
But that does look like a typo indeed 👀
Good catch. It's definitely worth reporting it, this is confusing
a
oh okay
@mbonnin still getting this: Error resolving plugin [id: ‘org.jetbrains.kotlin.android’, version: ‘1.5.30’]
Plugin request for plugin already on the classpath must not include a version
could it be this
Copy code
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
m
Yes, you need to use either one or the other but not both
(or just remove the version)
292 Views