I’m building an app with minSdk 23 but also have k...
# android
m
I’m building an app with minSdk 23 but also have kotlin compile options set to target jvm 1.8. I see now that sdk 23 does not support jvm 1.8, so I’m left with a choice between increasing minSdk to 24 or lowering compile target to 1.6. What are the obvious drawbacks of targeting 1.6 (for a kotlin-only app)? Anything else I should be considering?
Hmm, actually it seems it does work, it’s just that I wasn’t using:
Copy code
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
For some reason, I thought that the kotlin compiler target would be enough for a kotlin-only project.
g
D8 supports desugaring, it will be just converted to Java 1.6 bytecode (or more precisely to Dex compatible with older versions of Android)
m
How about with min SDK 24, shouldn’t it just compile to 1.8?
g
Yes, than desugaring is not needed also you have access to all new Java 8 APIs like Streams, Optional (which are not available even with desugaring)
m
Is desugaring automatically turned off with min SDK 24, or is there some flag I need to set?
g
Not sure will it be disabled or not automatically, but there is a flag to disable it explictly https://developer.android.com/studio/write/java8-support#disable
👍 1