https://kotlinlang.org logo
#android
Title
# android
l

Liyue

10/14/2020, 4:03 AM
Hi, I am a new kotlin developer For some reasons, I need to pay attention to the association between Android Kotlin and official Kotlin. Is the official Kotlin compiler used for Android project compilation?
z

Zach Klippenstein (he/him) [MOD]

10/14/2020, 4:31 AM
Yes
g

gildor

10/14/2020, 4:31 AM
need to pay attention to the association between Android Kotlin and official Kotlin
What do you mean?
Is the official Kotlin compiler used for Android project compilation
Yes, there is only one Kotlin compiler for JVM (which also used for Android, where Kotlin sources compiled to JVM bytecode and bytecode to Dex files, it’s the same as for Java sources) Though, there are Kotlin Android Gradle plugin and separate Kotlin (aka Kotlin JVM) Gradle plugins, but both of them use the same compiler, but provide integration with different types of project
l

Liyue

10/14/2020, 5:30 AM
Got it! Thank you @gildor
f

Fatih Yalmanbas

10/15/2020, 2:02 PM
Dont wanna expand the scope of the question much but this brings another question. So is there any specific difference between kotlin and kotlin-android plugins in terms of compiler usage such as parameters, sourcesets etc. ? Or is it just for kotlin-android extensions and android build tools dependency?
g

gildor

10/15/2020, 11:39 PM
Source sets are different for jvm and Android projects, not sure about any differences in other params