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

Application will not run on Apple Silicon (ARM M1 chip), MacOS for M1, or Windows ARM64 #110

Closed
adrian-maggio opened this issue Aug 11, 2021 · 8 comments

Comments

@adrian-maggio
Copy link

When attempting to run on an M1 (arm based) MacBook, I get an error popup that says "JRELoadError". I can't seem to find any other log messages.

When I attempt to run on that same M1 MacBook, but this time under Windows (arm version), under Parallels, I get this log output:

Version: 4.10.0
OS: Windows 10 10.0 aarch64
JRE: 16.0.2 Azul Systems, Inc.
com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load shared library 'gdx64.dll' for target: Windows 10, 64-bit
at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:120)
at com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:33)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3NativesLoader.load(Lwjgl3NativesLoader.java:28)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.initializeGlfw(Lwjgl3Application.java:81)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.(Lwjgl3Application.java:92)
at com.crashinvaders.texturepackergui.desktop.ApplicationStarter.start(ApplicationStarter.java:56)
at com.crashinvaders.texturepackergui.desktop.ApplicationStarter.main(ApplicationStarter.java:35)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: java.lang.UnsatisfiedLinkError: C:\Users\adrianmaggio\AppData\Local\Temp\libgdxadrianmaggio\d6a9e29c\gdx64.dll: Can't load AMD 64-bit .dll on a ARM 64-bit platform
at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:316)
at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:116)
... 6 more
Caused by: java.lang.UnsatisfiedLinkError: C:\Users\adrianmaggio\AppData\Local\Temp\libgdxadrianmaggio\d6a9e29c\gdx64.dll: Can't load AMD 64-bit .dll on a ARM 64-bit platform
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:383)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:227)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:169)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2383)
at java.base/java.lang.Runtime.load0(Runtime.java:746)
at java.base/java.lang.System.load(System.java:1857)
at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:322)
at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:291)
... 7 more

When I try to build from source on the M1 MacBook, I get errors loading a intel-based shared library:

com.badlogic.gdx.utils.SharedLibraryLoadRuntimeException: Couldn't load shared library 'libbasisu-wrapper64.dylib' for target: Mac OS X, 64-bit

Full error message below if needed.

I looked into the libbasisu library, and there is no ARM version of it.

com.badlogic.gdx.utils.SharedLibraryLoadRuntimeException: Couldn't load shared library 'libbasisu-wrapper64.dylib' for target: Mac OS X, 64-bit
at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:122)
at com.crashinvaders.basisu.BasisuWrapperTest.init(BasisuWrapperTest.java:28)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.RunBefores.invokeMethod(RunBefores.java:33)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:119)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.badlogic.gdx.utils.SharedLibraryLoadRuntimeException: java.lang.UnsatisfiedLinkError: /private/var/folders/bz/8v5bdnq17cn64jv1fth7srzh0000gn/T/libgdxadrianmaggio/b59e19a8/libbasisu-wrapper64.dylib: dlopen(/private/var/folders/bz/8v5bdnq17cn64jv1fth7srzh0000gn/T/libgdxadrianmaggio/b59e19a8/libbasisu-wrapper64.dylib, 1): no suitable image found. Did find:
/private/var/folders/bz/8v5bdnq17cn64jv1fth7srzh0000gn/T/libgdxadrianmaggio/b59e19a8/libbasisu-wrapper64.dylib: file too short
/private/var/folders/bz/8v5bdnq17cn64jv1fth7srzh0000gn/T/libgdxadrianmaggio/b59e19a8/libbasisu-wrapper64.dylib: file too short
at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:318)
at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:118)
... 42 more
Caused by: java.lang.UnsatisfiedLinkError: /private/var/folders/bz/8v5bdnq17cn64jv1fth7srzh0000gn/T/libgdxadrianmaggio/b59e19a8/libbasisu-wrapper64.dylib: dlopen(/private/var/folders/bz/8v5bdnq17cn64jv1fth7srzh0000gn/T/libgdxadrianmaggio/b59e19a8/libbasisu-wrapper64.dylib, 1): no suitable image found. Did find:
/private/var/folders/bz/8v5bdnq17cn64jv1fth7srzh0000gn/T/libgdxadrianmaggio/b59e19a8/libbasisu-wrapper64.dylib: file too short
/private/var/folders/bz/8v5bdnq17cn64jv1fth7srzh0000gn/T/libgdxadrianmaggio/b59e19a8/libbasisu-wrapper64.dylib: file too short
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2627)
at java.base/java.lang.Runtime.load0(Runtime.java:768)
at java.base/java.lang.System.load(System.java:1837)
at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:324)
at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:293)
... 43 more

@metaphore
Copy link
Member

Yeah, that's more or less expected, as the app is only build to work on x86/x64 systems. Generally speaking, it doesn't take much to make it run on arm Windows, but for Apple's M1 it will take time till LibGDX start to support it (expectedly next stable release).

I'd keep that one open till the arm support kicks in.

@devDolan
Copy link

Have you tried running java -jar -XstartOnFirstThread /Applications/GDX\ Texture\ Packer.app/Contents/java/desktop.jar

@metaphore
Copy link
Member

It's not gonna help if the app is running on M1 system. LibGDX's LWJGL3 backend doesn't not yet support the platform.

@metaphore metaphore added the bug label Aug 22, 2021
@adrian-maggio
Copy link
Author

Yeah, that's more or less expected, as the app is only build to work on x86/x64 systems. Generally speaking, it doesn't take much to make it run on arm Windows, but for Apple's M1 it will take time till LibGDX start to support it (expectedly next stable release).

I'd keep that one open till the arm support kicks in.

Thanks. I'll wait until it's supported.

@metaphore metaphore added enhancement and removed bug labels Sep 15, 2021
@Trikzon
Copy link

Trikzon commented Sep 30, 2021

I just wanted to report that running java -jar -XstartOnFirstThread /Applications/GDX\ Texture\ Packer.app/Contents/java/desktop.jar on an m1 macbook air does work.

LibGDX does give an error message, but it does that when developing with LibGDX on m1 anyways rn. If you ignore the error in the console, everything works exactly like it is meant to.

After further testing, even though the GUI loads correctly as soon as you press "Pack" the window freezes and doesn't complete the packing operation. There's no reported error in the console after pressing "Pack".

@metaphore
Copy link
Member

Hm, I'm not sure if that's possible though, there's simply no binaries for ARM based macOS in the distribution.
There's a chance that some new fancy instruction translation layer kicks in from the recent OS or JRE update, but I'm not aware of any.

On my M1 Macbook the last release crashes as expected.

The good news is the support for this platform is already implemented for the upcoming new version and it should work as usual right out of the box.

@Trikzon
Copy link

Trikzon commented Oct 5, 2021

I do have Rosetta 2 installed on my macbook. I have no idea if that works automatically and that's why the GUI shows up or something else because I don't know how to use Rosetta 2

@metaphore
Copy link
Member

This is now implemented and included in the 4.10.1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants