MinnDevelopment / discord-webhooks

Provides easy to use bindings for the Discord Webhook API
Apache License 2.0
180 stars 34 forks source link

No virtual method put(Ljava/lang/String;Ljava/util/Collection;)Lorg/json/JSONObject #62

Closed t0pd3v1c3 closed 2 years ago

t0pd3v1c3 commented 2 years ago

Hello. I get an error when linking the library:

java.lang.NoSuchMethodError: No virtual method put(Ljava/lang/String;Ljava/util/Collection;)Lorg/json/JSONObject; in class Lorg/json/JSONObject; or its super classes (declaration of 'org.json.JSONObject' appears in /apex/com.android.runtime/javalib/core-libart.jar)
        at club.minnced.discord.webhook.send.WebhookEmbed.toJSONString(WebhookEmbed.java:215)
        at club.minnced.discord.webhook.send.WebhookEmbed.toString(WebhookEmbed.java:190)
        at org.json.JSONStringer.value(JSONStringer.java:261)
        at org.json.JSONArray.writeTo(JSONArray.java:616)
        at org.json.JSONStringer.value(JSONStringer.java:242)
        at org.json.JSONObject.writeTo(JSONObject.java:733)
        at org.json.JSONObject.toString(JSONObject.java:701)
        at club.minnced.discord.webhook.send.WebhookMessage.getBody(WebhookMessage.java:354)
        at club.minnced.discord.webhook.WebhookClient.send(WebhookClient.java:304)
MinnDevelopment commented 2 years ago

This library requires version 20210307 of org.json:json and you are using a different version. I recommend using gradle and adding the required dependency explicitly.