Android update 17 seems incompatible with external Jars
Asked Answered
P

3

19

I just allowed my Mac to do an update on its Java installation and now some of my old jars (like javax.mail and apache.commons.httpclient) are throwing "class not found" exceptions at run time!

Meaning, they compile fine, but then crash at run time with exceptions that look like this:

E/dalvikvm(2414): Could not find class 'javax.mail.internet.InternetAddress', referenced from method com.my.project.Main.isValidEmailAddress

Do I need to get more recent versions of the jars that have those classes? Or do I need to revert to my previous version of Java?

Or is this some totally unrelated problem that I'm just assuming has to do with the Java update (would be quite a coincidence, all of this worked perfectly prior to the update)?

Polarization answered 6/4, 2012 at 16:28 Comment(2)
are u talking about external jar files ?Horologe
yes, specifically I've been using apache-commons 3.0 and that appears to no longer be compatible.Polarization
H
75

crash at run time with exceptions that look like this: Could not find class 'javax.mail.internet.InternetAddress', referenced from method com.my.project.Main.isValidEmailAddress

If you have problems with external jars, then:

  1. create a folder named libs.
  2. Copy and paste all needed external jar files into that folder.

It will automatically be included, as explained on this page: Dealing with dependencies in Android projects

Horologe answered 6/4, 2012 at 17:8 Comment(3)
try this because i have also face problem like this and solved bu putting all jar files in libs folderHorologe
But whenever I am updating the ADT, it is asking to update SDK. And after updating its showing "An error has occurred. See error log for more details. com.android.ddmlib.IDevice.getName()Ljava/lang/String; ". If uninstallation is the solution, then how do I update the ADT as well as SDK tools? I uninstall and reinstall this to solve this issue many times. But how do I update all and run the build successfully? Its really required.Stricken
Just out of curiousity, isn't this the same as the Referenced Libraries section of the project? My eclipse was handling this just fine and now all of the sudden I am getting this error.Ody
I
2

Same thing happened to me but my folder was labeled "lib" instead of "libs" arg! updating was a little rough this time around... fixed after removing the external jars from the project settings and changing the folder to libs

Iaea answered 20/5, 2012 at 4:43 Comment(0)
W
1

If renaming the lib to libs doesn't work then try this.

Wheat answered 27/11, 2012 at 6:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.