Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window not working on 0.3.0 build 153 #392

Closed
shynline opened this issue Feb 16, 2021 · 7 comments
Closed

Window not working on 0.3.0 build 153 #392

shynline opened this issue Feb 16, 2021 · 7 comments

Comments

@shynline
Copy link

I was using 0.3.0-build152 until I found MenuBar API not working at all
I released I'm not on the latest version so I updated to 0.3.0-build153
now even Window doesn't work on a fresh new project.

fun main() = Window {

}

This throws the following exception

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: kotlinx/collections/immutable/ExtensionsKt
	at androidx.compose.runtime.Recomposer.<clinit>(Recomposer.kt:834)
	at androidx.compose.ui.platform.DesktopOwners.<init>(DesktopOwners.desktop.kt:73)
	at androidx.compose.desktop.ComposeLayer.<init>(ComposeLayer.desktop.kt:59)
	at androidx.compose.desktop.ComposeWindow.<init>(ComposeWindow.desktop.kt:33)
	at androidx.compose.desktop.AppWindow.<init>(AppWindow.desktop.kt:114)
	at androidx.compose.desktop.AppWindow.<init>(AppWindow.desktop.kt)
	at androidx.compose.desktop.AppWindow_desktopKt$Window$1.run(AppWindow.desktop.kt:83)
	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.ClassNotFoundException: kotlinx.collections.immutable.ExtensionsKt
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 20 more

Process finished with exit code 0

I tried to rebuild the project after a cleanup so far

@shynline
Copy link
Author

Oh actually 0.3.0-build153 came 6 hrs ago then probably have to create a new issue for MenuBar but I don't know it still exists in 0.3.0-build153 or not

@Rsedaikin
Copy link
Contributor

Could you tell us about the OS you are running on?

@igordmn
Copy link
Collaborator

igordmn commented Feb 16, 2021

now even Window doesn't work on a fresh new project.

Can, you check that https://github.com/JetBrains/compose-jb/tree/master/templates/desktop-template work with build153?

On my machine it works.

Maybe there is something broken in the gradle cache.

Try to run ./gradlew clean --refresh-dependencies and run app again.

@Rsedaikin
Copy link
Contributor

MenuBar API not working at all

Could you give some reproducer? MenuBar not appear or something else? Examples in Window API tutorial works "fine".

@shynline
Copy link
Author

Could you tell us about the OS you are running on?

Ubuntu 20.04

Try to run ./gradlew clean --refresh-dependencies and run app again.

Didn't work

But the template worked and after comparing it with my project the only difference was

tasks.withType<KotlinCompile>() {
   kotlinOptions.jvmTarget = "11"
}

which is IntelliJ generated. I removed it and it worked too.
Thanks

@shynline
Copy link
Author

MenuBar API not working at all

Could you give some reproducer? MenuBar not appear or something else? Examples in Window API tutorial works "fine".

Yea actually the problem still exists in 153

basically at startup menu bar is not visible at all
and after a small window resize it appear
but if you tap on the menu items the pop-up is kinda behind the window area.
A reeeaally small part if it, is visible.

fun main() = Window(
    menuBar = MenuBar(
        Menu(
            name = "Files",
            MenuItem("New", onClick = {}),
        ),
    )
) {

}

note that the exact code works on 0.2.0 build 132

@shynline
Copy link
Author

I close this issue since the MenuBar bug is unrelated and I'll open a new one after the next release version if necessary.

MatkovIvan pushed a commit to MatkovIvan/compose-multiplatform that referenced this issue May 10, 2023
Selection handlers
And Context Menu (JetBrains#2682)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants