升级到 ADT 22 后,库不再添加到 APK [英] Libraries do not get added to APK anymore after upgrade to ADT 22

查看:37
本文介绍了升级到 ADT 22 后,库不再添加到 APK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个相当大的 Android 应用项目,它引用了几个库项目.一切都很好,直到我将 eclipse ADT 插件升级到最新版本 (v22).我当然也升级了SDK.我在 Eclipse 中没有看到任何编译错误,但是当我在手机上运行该项目时,我收到了 NoClassDefFoundError.

I have a rather big Android App project that is referencing several library projects. Everything was fine until i upgraded the eclipse ADT plugin to the newest version (v22). I also upgraded the SDK of course. I do not see any compile errors in eclipse, but when i run the project on the phone i get a NoClassDefFoundError.

java.lang.NoClassDefFoundError: org.acra.ACRA
....

arca 库包含在引用的库项目之一(在 libs 文件夹中)中,我可以在包资源管理器的Android 私有库"中看到它,正如我所说,没有编译错误.该项目在没有升级 ADT 的其他人的计算机上运行良好.

The arca library is included in one of the referenced library project (in the libs folder) and i can see it in the "Android Private Libraries" in the package explorer, also as i said, no compile errors. The project runs fine on everyone else's computer that did not upgrade ADT.

我已经尝试了很多东西,包括但不限于:

I have already tried a whole bunch of stuff including but not limited to:

  • 重新安装安卓 SDK
  • 下载新的 ADT 包
  • 删除我所有的代码并从 git 中重新获取
  • 将有问题的库复制到应用项目
  • 注释掉使用这个库的代码 - 我只是在下一个库中得到同样的错误

一切都没有成功,所以我在这里真的很绝望.

all without any success, so i'm getting really desperate here.

如果有人能给我一个如何解决这个问题的提示,我会很高兴.

I would be really happy if anyone could give me a hint on how to solve that problem.

推荐答案

Quoting Streets of Boston from 他的 adt-dev 帖子:

Quoting Streets of Boston from his adt-dev post:

升级时,新的Android Private"的Order and Export"图书馆"并不总是被检查.android-support-v4.jar 现在在这个Android 私人图书馆"部分.

When upgrading, the 'Order and Export' of the new 'Android Private Libraries' is not always checked. And the android-support-v4.jar is now in this 'Android Private Libraries' section.

要解决此问题,请转到订购和导出"并选中Android 私有"图书馆".然后刷新/清理/重建.

To fix this, go to 'Order and Export' and check 'Android Private Libraries'. Then refresh/clean/rebuild.

为库项目完成此修复"后,您可能需要关闭并重新打开任何依赖项目,因为他们可能看不到这个修复"立即地.

After you done this 'fix' for a library project, you may need to just close and re-open any depending project, because they may not see this 'fix' immediately.

试一试,如果幸运的话,它会解决您的问题.

Give this a shot and with luck it will solve your problem.

这篇关于升级到 ADT 22 后,库不再添加到 APK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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