Android 更新 17 似乎与外部 Jars 不兼容 [英] Android update 17 seems incompatible with external Jars
问题描述
我只是允许我的 Mac 对其 Java 安装进行更新,现在我的一些旧 jar(例如 javax.mail
和 apache.commons.httpclient
)是在运行时抛出 class not found" 异常!
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
我是否需要获得具有这些类的 jar 的更新版本?还是我需要恢复到以前的 Java 版本?
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?
或者这是一些完全不相关的问题,我只是假设与 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)?
推荐答案
在运行时崩溃,异常如下所示:
找不到类javax.mail.internet.InternetAddress",从方法 com.my.project.Main.isValidEmailAddress 引用
如果您在使用外部 jar 时遇到问题,则:
If you have problems with external jars, then:
- 创建一个名为
libs
的文件夹. - 将所有需要的外部 jar 文件复制并粘贴到该文件夹中.
它将自动包含在内,如本页所述:处理 Android 项目中的依赖项
It will automatically be included, as explained on this page: Dealing with dependencies in Android projects
这篇关于Android 更新 17 似乎与外部 Jars 不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!