Unable to resolve static method

2.5k views Asked by At

I have been messing around with steam-condenser and have made an android app to test out some small bits like grabbing achievements but have run into problems with one of the classes inside the .jar file.

The method imports org.json.JSONObject and calls the getNames() method from the json-java.jar found at json.org. When compiling there is no errors but when I run the app and execute that method, it seems to point back to the default Android org.json.JSONObject which does not have a getNames() method.

The error can be seen here:

05-01 13:08:47.869: W/dalvikvm(1012): VFY: unable to resolve static method 13252: Lorg/json/JSONObject;.getNames (Lorg/json/JSONObject;)[Ljava/lang/String;

This eventually causes a runtime error and stops the application in it's tracks. Is there a way to make sure the app/steam-condenser.jar imports the correct library?

1

There are 1 answers

0
sevensevens On

Can't help you much without posting your code.

A quick guess would be your external JAR library is not being exported. In Eclipse,

right-click the project->Properties->Java Build Path->Order and Export

Be sure that your jar has a check by it, meaning that it is exported with your apk.