discord-rpc-java icon indicating copy to clipboard operation
discord-rpc-java copied to clipboard

Issues with type values on Json arrays in Json, errored

Open VenomiXeD opened this issue 6 years ago • 1 comments

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)

VenomiXeD avatar Jun 05 '18 15:06 VenomiXeD

Are you using another version of Gson in your program ?

My lib is using 2.8.2, this looks like a conflict issue.

Rigner avatar Jun 13 '18 17:06 Rigner