https://kotlinlang.org logo
Title
j

Javier

01/05/2021, 2:48 PM
I am getting this error (JDK 11 or 15, Gradle 6.6 and 6.7.1, build 138 and 139)
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
	at androidx.compose.desktop.ComposeLayer.<init>(ComposeLayer.kt:72)
	at androidx.compose.desktop.ComposeWindow.<init>(ComposeWindow.kt:26)
	at androidx.compose.desktop.AppWindow.<init>(AppWindow.kt:107)
	at androidx.compose.desktop.AppWindow.<init>(AppWindow.kt)
	at androidx.compose.desktop.AppWindowKt$Window$1.run(AppWindow.kt:76)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:316)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.NullPointerException
	at java.base/java.io.Reader.<init>(Reader.java:167)
	at java.base/java.io.InputStreamReader.<init>(InputStreamReader.java:72)
	at org.jetbrains.skiko.Library.load(Library.kt:42)
	at org.jetbrains.skija.impl.Library$Companion.staticLoad(Library.kt:9)
	at org.jetbrains.skija.impl.Library.staticLoad(Library.kt)
	at org.jetbrains.skija.PictureRecorder.<clinit>(PictureRecorder.java:9)
	... 18 more
k

Kirill Grouchnikov

01/05/2021, 2:52 PM
https://github.com/JetBrains/compose-jb/issues - report there with the details of your OS
j

Javier

01/05/2021, 2:53 PM
But it is strange I have this problem with a minimum setup
I think I am missing something
I knew it should have to be a stupid thing, I was missing this dep:
implementation(compose.desktop.currentOs)
x

xetra11

01/05/2021, 3:00 PM
Hm at least I'd wish to have a hint in the exception for this
1
j

Javier

01/05/2021, 3:04 PM
I don't know if this block exists and the dep is missing it has sense to show a hint, can
compose.desktop
work without that dep?
compose.desktop {
    application {
        mainClass = "..."
    }
}
j

jim

01/05/2021, 4:48 PM
At the very least Skiko could throw a more informative error message at runtime by checking to see if the resource
InputStream
is null prior to passing it to the
InputStreamReader
, and throwing a helpful/suggestive error message instead of a NullPointerException. Compose-desktop could then catch that new exception type and rethrow it as an even more informative/helpful error message. https://github.com/JetBrains/skiko/issues/35 https://github.com/JetBrains/compose-jb/issues/249 Please feel free to add detail to those bugs if there is anything I missed.
:tnx: 2
👍 1