Also, I believe ```android {   ...   compileOption...
# android
r
Also, I believe
Copy code
android {
  ...
  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }

  kotlinOptions {
    jvmTarget = "1.8"
  }
}
compileOptions
can be safely dropped from 100% kotlin application. Using
kotlinOptions.jvmTarget="11"
is there a downside to it, in terms of byte-code generation and byte-code compatibility with other jdk versions.
e
requires AGP 7.0+ to desguar apps for API levels 29 and earlier, versus targeting 8 only requires AGP 3.0+ to desugar apps for API levels before 24 (IIRC). if you're building a library, can't inline into consumers using a lower target.
otherwise most bytecode is the same and that which isn't - indy lambdas and string concat, also some new classes and methods - can be desugared
r
If we rule out library and also consider project is running on AGP 7.0+
kotlinOptions.jvmTarget="11"
should be fine.
e
oh, one more thing to note: Android projects are not pure-Kotlin, as there's the generated BuildConfig.java
r
yep, for kotlin only modules, java compile options can be avoided.