1

I have imported a .jar into my Eclipse Android project (importing it to the libs folder and adding the jar to the libraries in Java Build Path), but when I attempt to use it, I get a java.lang.VerifyError. The library is Jiwigo 0.13.1.1; a java library for accessing Piwigo image galleries. I know this should work, because there's an open source android project called RegalAndroid that uses it too (though, an older version, and it copied the source instead of properly importing it). The .jar is the only copy of the library on my computer, so I'd be surprised if it was a version clash error. Any ideas?

Here's my error log (shortened because all the rest is normal android stuff):

FATAL EXCEPTION: main
java.lang.VerifyError: fr.mael.jiwigo.transverse.session.SessionManager
at com.terrapages.itemdetailsactivities.FavoritesDetailsActivity.initViews(FavoritesDetailsActivity.java:179)
at com.terrapages.itemdetailsactivities.FavoritesDetailsActivity.onResume(FavoritesDetailsActivity.java:83)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1149)
at android.app.Activity.performResume(Activity.java:3823)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3118)
[...]

And the line it crashes on (with dummy string values that are different in the code):

SessionManager sessionManager = new SessionManager("username", "password", "gallery-url");

This is the first use of the library anywhere in the code.

AlbeyAmakiir
  • 2,217
  • 6
  • 25
  • 48
  • duplicate of http://stackoverflow.com/questions/668788/android-java-lang-verifyerror – Spike Gronim Mar 23 '11 at 23:32
  • It is not a duplicate, because I have imported it properly, it is not a method in java.lang that is unsupported (or, if it is, it isn't telling me. In which case, how do you tell? That answer gives no detail about that), and I have tried everything else on that question. – AlbeyAmakiir Mar 23 '11 at 23:52

3 Answers3

3

I'm the developer of Jiwigo and read this post this afternoon by chance. As I do not develop on Android, I didn't even know that my api was not compatible with android.

So after I read this post, I made some changes on my API : I replaced the old Apache HttpClient version with a newest one : 4.1 (I think it's compatible with android isn't it ?) And I removed all JDom references. The code now uses org.w3c.dom.Document instead. The jar is here : http://maven.le-guevel.com/artifactory/libs-release-local/fr/mael/jiwigo/jiwigo-ws-api/0.2b/

As I said, I just made the modifications this afternoon, and I did not test it very well, so it could be unstable (it seems to work on my project).

Bye.

mael
  • 31
  • 1
  • Lucky me :). According to a site I found, "The Apache HTTP Client 4 is included in the Android distribution...", so that's good. But I get a `FATAL EXCEPTION: main java.lang.NoSuchMethodError: org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager. at fr.mael.jiwigo.transverse.session.SessionManager.(SessionManager.java:109)` Though this may not be the place to go on about this. I'm happy to test stuff out. :) Thanks. – AlbeyAmakiir Mar 28 '11 at 04:48
2

Any ideas?

SessionManager is using a class or method that does not exist in Android. Assuming this is the source for the class in question, there is no way that will work on Android without substantial modifications, as it uses:

  • an old version of Apache HttpClient
  • JDOM

neither of which are in Android.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Ah... then I'm going to have to find out how RegalAndroid does it, because it certainly uses Jiwigo in some form or other. Thanks. – AlbeyAmakiir Mar 24 '11 at 00:55
0

I had a similar issue with my projects after doing the Android ADT , and Java updates.

Try these steps

  1. Remove links to your external libraries in your Android project.

  2. Move all your external libraries (including Google Ad libraries) to \libs folder inside your Android project.

  3. Re-link your libraries, that now exist in the Project\libs directory.

Hopefully this will help

Jon Lin
  • 142,182
  • 29
  • 220
  • 220
Imran Haidry
  • 108
  • 1
  • 4