Android 更新 17 似乎与外部 Jars 不兼容 [英] Android update 17 seems incompatible with external Jars

查看:17
本文介绍了Android 更新 17 似乎与外部 Jars 不兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是允许我的 Mac 对其 Java 安装进行更新,现在我的一些旧 jar(例如 javax.mailapache.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:

  1. 创建一个名为 libs 的文件夹.
  2. 将所有需要的外部 jar 文件复制并粘贴到该文件夹​​中.

它将自动包含在内,如本页所述:处理 Android 项目中的依赖项

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

这篇关于Android 更新 17 似乎与外部 Jars 不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆