Unciv: Unciv not working in Raspberry Pi 3B+ (Linux armhf)

Hi! I tried to run Unciv in Raspberry Pi and got the following errors.

~$ java -jar Unciv.jar
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
Packing textures - 349ms
Could not initialize Discord
Exception in thread "main" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load shared library 'libgdxarm.so' for target: Linux, 32-bit
        at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:126)
        at com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:31)
        at com.badlogic.gdx.backends.lwjgl.LwjglNativesLoader.load(LwjglNativesLoader.java:46)
        at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:83)
        at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:71)
        at com.unciv.app.desktop.DesktopLauncher.main(DesktopLauncher.kt:67)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Unable to read file for extraction: libgdxarm.so
        at com.badlogic.gdx.utils.SharedLibraryLoader.readFile(SharedLibraryLoader.java:134)
        at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:290)
        at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:122)
        ... 5 more

Note that Raspberry Pi comes pre-installed with Java 11. I tried to manually install java8-jre, setting it as default and run Unciv, but got same kind of error. I tried using Windows 32 bit jar. It also failed.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 23 (21 by maintainers)

Most upvoted comments

@asda488 @yairm210 yes the Game is confirmed to be working on Raspberry Pi from version 3.18.0. The command java -jar Unciv.jar works fine. I have tested Mods too. Both RekMOD and 5Hex Tileset is working fine. And yes I am using an Raspberry Pi OS armhf. Here is a Screenshot from Pi, unciv-on-raspberrypi

Fixed for aarch64/arm64 building .jar file without Android Studio and with JDK11, building commit 25cad3a. Should also work on armhf as they are the same arch, just different bit, unless something hasn’t been ported across, but that is unlikely, I think we would just need a confirmation from touhidurrr to close this issue, hopefully it works 😃. (As above, most probably the upgrade to LWJGL 3 that fixed it.)

Ok, so does the latest release has this fix? Ok I will start testing now.

Update: I tested Release 3.17.14 but it threw the following error.

~$ java -jar ./Unciv.jar
Packing textures - 325ms
Could not initialize Discord
[LwjglApplication] Couldn't initialize audio, disabling audio
java.lang.UnsatisfiedLinkError: /tmp/libgdxpi/e06d3531/liblwjgl.so: /tmp/libgdxpi/e06d3531/liblwjgl.so: cannot open shared object file: No such file or directory (Possible cause: can't load IA 32-bit .so on a ARM-bit platform)
	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 org.lwjgl.Sys$1.run(Sys.java:70)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
	at org.lwjgl.Sys.loadLibrary(Sys.java:96)
	at org.lwjgl.Sys.<clinit>(Sys.java:117)
	at org.lwjgl.openal.AL.<clinit>(AL.java:59)
	at com.badlogic.gdx.backends.lwjgl.audio.OpenALLwjglAudio.<init>(OpenALLwjglAudio.java:72)
	at com.badlogic.gdx.backends.lwjgl.LwjglApplication.createAudio(LwjglApplication.java:282)
	at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:90)
	at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:71)
	at com.unciv.app.desktop.DesktopLauncher.main(DesktopLauncher.kt:56)
Exception in thread "LWJGL Application" java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.Sys
	at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
	at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.setVSync(LwjglGraphics.java:643)
	at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:125)

Update 2: Ok, 3.17.14 was released 2 days ago while the commit https://github.com/yairm210/Unciv/commit/25cad3aef2e3fb38a2088840cf7c768021cd2fb8 was made yesterday. I need to wait for the next release to test it.

Awesome! 😃

I’d close it then.

I have the .jar I built myself here, if you really wanted to you could probably test it before next release, up to you. It contains binaries for armhf so hopefully it works.

Fixed for aarch64/arm64 building .jar file without Android Studio and with JDK11, building commit 25cad3a. Should also work on armhf as they are the same arch, just different bit, unless something hasn’t been ported across, but that is unlikely, I think we would just need a confirmation from touhidurrr to close this issue, hopefully it works 😃. (As above, most probably the upgrade to LWJGL 3 that fixed it.)

I’m back from trawling through the internet, and it looks like the problem is with GDX’s building of native dependency binaries, but since you are upgrading to LWJGL 3 they seem to have fixed binaries for LWJGL and OpenAL for LWJGL 3 on ARM devices, so I’ll rebuild and/or test the prebuilt .jar after you merge/after you release. Hopefully should fix this and #5022. 🤞 @touhidurrr you may want to test this as well.