Rigner / discord-rpc-java

Java implementation of Discord RPC for rich presence https://github.com/discordapp/discord-rpc
MIT License
25 stars 9 forks source link

Issues with type values on Json arrays in Json, errored #16

Open VenomiXeD opened 6 years ago

VenomiXeD commented 6 years ago

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)

Rigner commented 6 years ago

Are you using another version of Gson in your program ?

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