yairm210 / Unciv

Open-source Android/Desktop remake of Civ V
Mozilla Public License 2.0
8.6k stars 1.58k forks source link

Unciv for Java Fails to run #3283

Closed PaxiTheAlchemist closed 4 years ago

PaxiTheAlchemist commented 4 years ago

Unciv for Java Fails to run

Describe the bug

Unciv Fails to run as Java throws errors in relation to missing discord-rpc libraries

To Reproduce

Steps to reproduce the behavior:

  1. Grab the latest Version of Unciv.jar (in my case version 3.11.6)
  2. Place Unciv.jar in its own directory (as recommended within the README.md due to files generating)
  3. Open the terminal within the directory containing the Unciv.jar
  4. Run Java -jar Unciv.jar within the terminal
  5. See error

Expected behavior

Seeing that the error occurs before the game can even launch, i'd assume the game is supposed to launch normally

Screenshots

Terminal: http://imgur.com/1oUqpk7l.png

Due to the error, no game window appears

Additional context

OS: Linux (Running a modified version of Ubuntu) Arch: armv7l Hardware: Raspberrypi 3 B+ with no accessories or physical modifications Java version: openjdk 11.0.8 2020-07-14 (OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1))

PaxiTheAlchemist commented 4 years ago

also it seems the output of the command was cut off within the screenshot, in anycase here is the raw output:

Packing textures - 317ms
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'discord-rpc': Native library (linux-arm/libdiscord-rpc.so) not found in resource path (Unciv.jar)
    at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:303)
    at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:427)
    at com.sun.jna.Library$Handler.<init>(Library.java:179)
    at com.sun.jna.Native.loadLibrary(Native.java:569)
    at com.sun.jna.Native.loadLibrary(Native.java:544)
    at club.minnced.discord.rpc.DiscordRPC.<clinit>(DiscordRPC.java:42)
    at com.unciv.app.desktop.DesktopLauncher.tryActivateDiscord(DesktopLauncher.kt:176)
    at com.unciv.app.desktop.DesktopLauncher.main(DesktopLauncher.kt:60)
yairm210 commented 4 years ago

LibGDX, and therefore Unciv, does not run on Raspberry pi.

MayeulC commented 3 years ago

I feel like this issue should be fixed, I encountered it today when launching on another ARM platform (pinephone).

As I prefer FLOSS, it annoys me that Unciv tries to load some native discord library, especially as it crashes right after because it hasn't been compiled on aarch64.

The game probably shouldn't crash if it can't find or load the discord library.

Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'discord-rpc': Native library (linux-aarch64/libdiscord-rpc.so) not found in resource path (/app/data/Unciv.jar)
       ...
    at club.minnced.discord.rpc.DiscordRPC.<clinit>(DiscordRPC.java:42)
    at com.unciv.app.desktop.DesktopLauncher.tryActivateDiscord(DesktopLauncher.kt:193)
    at com.unciv.app.desktop.DesktopLauncher.main(DesktopLauncher.kt:64)

(That's using the flatpak build)

A better title would be:

Unciv for Java Fails to run when Discord library cannot be loaded.

See also: https://github.com/yairm210/Unciv/issues/2361 https://github.com/yairm210/Unciv/issues/1624

BTW, I tried the .jar at https://github.com/yairm210/Unciv/releases/tag/3.4.8-raspberryPi but it seems I still get the issue.