0

I am using the following HTTP client library - https://github.com/kevinsawicki/http-request

...and when I use it inside my app, I get the following runtime error. My app compiles alright.

W/dalvikvm: VFY: unable to resolve static method 4110: Lcom/github/kevinsawicki/http/HttpRequest;.get(Ljava/lang/CharSequence;)Lcom/github/kevinsawicki/http/HttpRequest;

This is a github issue that I opened - https://github.com/kevinsawicki/http-request/issues/34

kapso
  • 11,703
  • 16
  • 58
  • 76

2 Answers2

0

It sounds like your library is not being packaged into your apk.

Read the section on setting up a library as well as using the library in another project. http://developer.android.com/tools/projects/projects-eclipse.html#SettingUpLibraryProject

Short story is the library needs to have the "Is Library" option enabled in its Android tab of the project properties. The consuming project needs to have that library added to the list of libraries on its project properties android tab.


Just getting started with Android Studio, myself, so I'm not sure what to do there. When I really have a question on whether something is in the APK here's what I do:

  1. Generate the APK. I know Eclipse puts this in the bin/ directory, not sure where AS puts it.
  2. extract it using unzip (7zip or unzip on Linux does this fine, some unzip programs require you rename the .apk to .zip)
  3. If your library contains non-java files, you'll see them in the APK.
  4. If the library is only java code, you'll need to pull the dex file apart with dex2jar. http://code.google.com/p/dex2jar/downloads/list

    [nedwidek@yule bin]$ d2j-dex2jar.sh classes.dex dex2jar classes.dex -> classes-dex2jar.jar [nedwidek@yule bin]$ unzip -l classes-dex2jar.jar

  5. Doing this shows that my APK for this particular project does indeed contain all of the class files for ActionBarSherlock.

Erik Nedwidek
  • 6,134
  • 1
  • 25
  • 25
0

I think you forgot check the export checkbox ,when you run. e.g.(F4 -> Project Structure, Module, select module, --> Dependencies)

Crossle Song
  • 10,104
  • 2
  • 29
  • 38