discord-rpc-java
discord-rpc-java copied to clipboard
Issues with type values on Json arrays in Json, errored
There's an issue with the Json system. When looking at this. The DiscordRichPresence I have set to PartySize=0, when it's going to encode the data to Json. It errors and the return type for getPartySize()
is an int. While JsonArray expect the "Number" type or class.
[17:03:51] [Thread-16/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: java.lang.NoSuchMethodError: com.google.gson.JsonArray.add(Ljava/lang/Number;)V
[17:03:51] [Thread-16/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.github.psnrigner.discordrpcjava.DiscordRichPresence.toJson(DiscordRichPresence.java:413)
[17:03:51] [Thread-16/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.github.psnrigner.discordrpcjava.DiscordRpc.updatePresence(DiscordRpc.java:201)
[17:03:51] [Thread-16/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at se.techlabz.mc.discord.rpc.utils.DiscordHook.lambda$updatePresence$1(DiscordHook.java:79)
[17:03:51] [Thread-16/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.Thread.run(Thread.java:748)
Are you using another version of Gson in your program ?
My lib is using 2.8.2, this looks like a conflict issue.