coil-kt / coil

Image loading for Android and Compose Multiplatform.
https://coil-kt.github.io/coil/
Apache License 2.0
10.86k stars 669 forks source link

Incompatible with JVM 1.8 #2

Closed felislynx-silae closed 5 years ago

felislynx-silae commented 5 years ago

If in build.gradle i have

compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
}

I'll get this error if i'll try to do imageView.load("url")

Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option

Stonos commented 5 years ago

According to https://coil-kt.github.io/coil/getting_started/ you also need to add the following to your build.gradle:

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
    kotlinOptions {
        jvmTarget = "1.8"
    }
}
colinrtwhite commented 5 years ago

Yep, you'll need to enable Kotlin's jvmTarget = "1.8". D8 should be able to desugar all the APIs if your minSdk is below 24. You may also need to update the Android Gradle Plugin to 3.4.2 or greater.