Unable to run android studio plugins built with jetpack compose
See original GitHub issueI am working on an Intellij plugin project that targets both Intellij and Android Studio. I have built the UI entirely using compose and have been doing pretty much all my testing exclusively in Intellij. However, when i installed the plugin into Android Studio, it threw an exception when i executed it. The summarised error is:
com.intellij.diagnostic.PluginException: While loading class org.jetbrains.skiko.SkiaLayer: org/jetbrains/skiko/SkiaLayer has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
I took a look at the runtime version of Android Studio, it is 1.8.0_242-release-1644-b3-6915495 x86_64. It seems that Skiko should have a jvm target flag to enable compatibility with Java 1.8.
Here is a link to a reproduce the issue. It is a modified version of the sample Jetpack compose plugin here but with changes to match my project settings.
https://gitlab.com/samuelprince411/compose-android-studio-plugin-bug
I used Android Studio 4.1.2 to reproduce this.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
I was referring to running the plugin, since Android Studio is built using JDK 8, does it mean it is not possible to get compose plugins running there?
I found out that it was a silly mistake from my side. All you have to do is when creating a new project select JRE instead of JDK in project configuration