Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

MewnBase

Space-cat crafting/survival game with base building. 路 By Cairn4

Mac Launch Crash Issues + Possible Fix

A topic by towersvault created Feb 13, 2022 Views: 375 Replies: 2
Viewing posts 1 to 3
(3 edits)

Hi Steve, thought I'd do a bit of digging to try and find out what could be causing the launch crash issues on MacOS.

Firstly, some system specs so you know what's going on:
macOS: Monterey 12.2
Model: MacBook Pro 13" 2020 M1
CPU/SoC: Apple M1
RAM: 8GB

From initially just pulling the JAR out of the app launcher and running it from the command line, I got the following error:

$ java -jar desktop-1.0.jar
MewnBase launch args:
[LWJGL] GLFW_PLATFORM_ERROR error
    Description : Cocoa: Failed to find service port for display
    Stacktrace  :
        org.lwjgl.glfw.GLFW.glfwInit(GLFW.java:830)
        com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.initializeGlfw(Lwjgl3Application.java:84)
        com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:91)
        com.cairn4.moonbase.desktop.DesktopLauncher.main(DesktopLauncher.java:62)

Now from what I can see, this seems to be related to GLFW in the current stable LibGDX build not supporting the Apple M series processors (Short StackOverflow thread)

I booted up a blank LibGDX project on my own Mac, LWJGL app config works fine, no issues. When I change it to LWJGL3 however, I run into the aforementioned crash since LWJGL3 now makes using of GLFW for interacting with the display/window stuff.

Now it seems the LibGDX 1.10.1 Snapshot fixes this (uses an updated version of GLFW) issue. I performed the following steps to get everything to work:

1. Set 'gdxVersion' to '1.10.1-SNAPSHOT' in my root build.gradle
2. Updated 'sourceCompatibility' to '1.8' in build.gradle in both my 'desktop' and 'core' folders
3. And then for just a regular debug run inside IntelliJ IDEA, I had to set '-XstartOnFirstThread'
for the VM options in the desktopLauncher config.
For running an actual compiled JAR, I had to run 'java -XstartOnFirstThread -jar ./desktop-1.0.jar'
Developer

This is super helpful, thanks again!  After 0.53 is released as Stable, I'll try making some test/beta macOS builds using the latest libGDX snapshot 馃

(+1)

I used the latest Mac version tagged "unstable" and had no problem running it on my M1 Max. I love the new critters!