Skip to content

Cannot run samples on Mac M3 Max #311

Description

@MuresanVladMihail

Hello, I'm trying to run the samples but I get the following error:

02:21:37: Executing ':com.littlekt.samples.game.SamplesKt.main()'…


> Configure project :
w: Target 'jvm': Unable to create run task 'jvmRun' as there is already such a task registered


> Task :checkKotlinGradlePluginConfigurationErrors SKIPPED
> Task :compileKotlinJvm UP-TO-DATE
Property 'jvm.mainClass' has either changed or has not been set. Check 'gradle.properties' and ensure it is properly set!
> Task :jvmProcessResources UP-TO-DATE
> Task :jvmMainClasses UP-TO-DATE

> Task :com.littlekt.samples.game.SamplesKt.main() FAILED
[Incubating] Problems report is available at: file:///Users/muresanvladmihail/Programming/gamedev/littlekt/littlekt-samples/build/reports/problems/problems-report.html

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.11.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
3 actionable tasks: 1 executed, 2 up-to-date
Exception in thread "main" java.lang.IllegalArgumentException: Misaligned access at address: 0x2
	at java.base/java.lang.invoke.VarHandleSegmentViewBase.newIllegalArgumentExceptionForMisalignedAccess(VarHandleSegmentViewBase.java:59)
	at java.base/java.lang.invoke.VarHandleSegmentAsInts.offsetPlain(VarHandleSegmentAsInts.java:99)
	at java.base/java.lang.invoke.VarHandleSegmentAsInts.get(VarHandleSegmentAsInts.java:110)
	at java.base/jdk.internal.foreign.AbstractMemorySegmentImpl.get(AbstractMemorySegmentImpl.java:776)
	at com.littlekt.graphics.webgpu._utilsKt.mapFromIntUntilNull(-utils.kt:57)
	at com.littlekt.graphics.webgpu.Surface.getCapabilities(webgpu.jvm.kt:856)
	at com.littlekt.graphics.webgpu.Surface.getPreferredFormat(webgpu.jvm.kt:867)
	at com.littlekt.LwjglGraphics.preferredFormat_delegate$lambda$0(LwjglGraphics.kt:53)
	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:83)
	at com.littlekt.LwjglGraphics.getPreferredFormat(LwjglGraphics.kt:53)
	at com.littlekt.resources.internal.InternalResources.load(InternalResources.kt:49)
	at com.littlekt.LwjglContext$start$1.invokeSuspend(LwjglContext.kt:184)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:263)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:47)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
	at com.littlekt.LwjglContext.start$core(LwjglContext.kt:87)
	at com.littlekt.LittleKtApp.start(LittleKtApp.kt:13)
	at com.littlekt.samples.game.SamplesKt.main(Samples.kt:15)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':com.littlekt.samples.game.SamplesKt.main()'.
> Process 'command '/Users/muresanvladmihail/.sdkman/candidates/java/22.0.1-amzn/bin/java'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 992ms
02:21:38: Execution finished ':com.littlekt.samples.game.SamplesKt.main()'.

I managed to reach this part only by doing the following:

Image

Even though there's this code in build.gradle.kts:

Image

unless I specify it manually as seen in the pic it complains that I need to add it.

MacOS version: 15.6 (24G84)
Java SDK: | >>> | 23.0.2 | amzn | installed | 23.0.2-amzn installed via sdkman!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions