Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android update 17 seems incompatible with external Jars

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)?

like image 663
Yevgeny Simkin Avatar asked Apr 06 '12 16:04

Yevgeny Simkin


3 Answers

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

like image 156
MAC Avatar answered Nov 12 '22 12:11

MAC


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

like image 23
Mike Avatar answered Nov 12 '22 10:11

Mike


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

like image 1
Phileo99 Avatar answered Nov 12 '22 10:11

Phileo99