https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
m

Marcin Wisniowski

12/04/2023, 6:43 PM
I'm not sure what this warning is trying to tell me, I already have the annotation it asks about. Is this a bug or am I missing something?
r

romainguy

12/04/2023, 6:45 PM
I’ve seen this bug a lot in my own Compose Desktop apps
1
a

Alexander Maryanovsky

12/04/2023, 7:26 PM
Use `-opt-in`;
-Xopt-in
was before Kotlin 1.6
m

Marcin Wisniowski

12/04/2023, 7:28 PM
I've tried it already but it also doesn't make the warning go away.
a

Alexander Maryanovsky

12/04/2023, 7:29 PM
What’s the library you’re opting in?
m

Marcin Wisniowski

12/04/2023, 7:29 PM
implementation(compose.desktop.components.animatedImage)
a

Alexander Maryanovsky

12/04/2023, 7:29 PM
I know there’s a bug with file-level opt-ins. Maybe it applies to gradle too…
Interesting. I’m not getting anything, and I don’t have any free compiler args
What version of Kotlin are you using?
m

Marcin Wisniowski

12/04/2023, 7:32 PM
Without it the Gradle file refuses to even sync. Kotlin 1.9.0
a

Alexander Maryanovsky

12/04/2023, 7:33 PM
I mean with the
@OptIn
but without the free compiler arg
I’m on Kotlin 1.9.21
m

Marcin Wisniowski

12/04/2023, 7:35 PM
Still getting the warning on 1.9.21
a

Alexander Maryanovsky

12/04/2023, 7:37 PM
Try the Clean/Invalidate Caches/Restart dance.
m

Marcin Wisniowski

12/04/2023, 7:46 PM
Didn't help, but this is looking suspicious. I'm not sure what it is, I ran the gradle
dependencies
task and there is no
1.6.21
anywhere.
a

Alexander Maryanovsky

12/04/2023, 7:48 PM
Can you ctrl-space and see if you can use a different
OptIn
?
Ah, I know, nm
The gradle script itself is running in Kotlin 1.6.21
👍🏻 1
That’s where it’s from
Look in gradle/wrapper/gradle-wrapper.properties and maybe update to a newer version. But in general, the version of Kotlin gradle is using will be fairly old.
I have
Copy code
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
m

Marcin Wisniowski

12/04/2023, 8:19 PM
That was is! I updated it from 7.5.1 to 8.5 and now the warning is gone. Thank you.
a

Alexander Maryanovsky

12/04/2023, 8:22 PM
Glad I could help
2 Views