Search code examples
javaandroidnosuchmethoderrortemboo

nosuchmethoderror of method valueToString in JsonObject class using temboo


I am making an android app where user will get newsfeed/timeline/dashboard from different social media accounts. I used Temboo to implement this.

During Oauth it gave me an error

Caused by: java.lang.NoSuchMethodError: No static method valueToString(Ljava/lang/Object;)Ljava/lang/String; in class Lorg/json/JSONObject; or its super classes (declaration of 'org.json.JSONObject' appears in /system/framework/core-libart.jar)

my app crashes all the time. i tried their tutorial app, it gave the same error. Need help :(

P.S.: if there is any other way that i could implement this please share. I am new to development.


Solution

  • Do you have an org.json.jar in your class library? It's possible that java is picking up an older version of the org.json.JSONObject which does not implement the method you need. The Temboo SDK bundles those classes, but in your case java might be finding some other version of that library before loading the Temboo library. Removing the other jar that has org.json classes in it or making sure it is loaded after the Temboo jar may solve the problem. It could also be that another jar of yours embeds org.json classes as well.