Gradle question: I'm upgrading a project to 1.2 an...
# announcements
d
Gradle question: I'm upgrading a project to 1.2 and all of a sudden I've got a errors because I'm calling static java methods and this is now prohibited. On further inspection, it looks like my IntelliJ project is being imported with a targetPlatform of 1.6. Any idea of the gradle magic to fix this? I've already got
Copy code
sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
in my gradle file, and the project SDK is set correctly to 1.8. Is there another flag I'm missing for
targetPlatform
?
d
I'm calling static java methods and this is now prohibited
Is it? I can't seem to find that in http://kotlinlang.org/docs/reference/whatsnew12.html
d
I think it's changed from a warning to an error - then again, I am upgrading a project from 1.1.X to 1.2.0 so I'm not sure when exactly that changed.
c
You have to set kotlin compile target to 1.8
d
yep - this was my problem! 🙂
c
Copy code
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
    kotlinOptions {
        // ...
    }
}
d
thanks - I actually already fixed it (see the next message below my original question) 🙂
c
Oh, sorry, I'm using my mobile at the moment and missed it
d
Also annoying on slack - you can't upload an image to a thread...
c
I use snaggy for that, but I too would've liked to have the functionality built-in