SDK更新后,意外的顶级异常 [英] Unexpected Top-Level Exception after SDK Update

查看:126
本文介绍了SDK更新后,意外的顶级异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个Android项目,该项目有一个Android库项目在其构建路径。
这两个项目在他们的库SDK的AdWhirl库文件夹和构建路径。

I'm working on an Android Project which has an Android Library Project in his Build Path. Both projects have the AdWhirl SDK library in their libs folder and Build Path.

现在由于更新Android SDK工具到R15主体工程的Ant构建于下列异常失败:

Now since updating android sdk tools to r15 the ant build of the main project fails on following exception:

[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
       [dx] java.lang.IllegalArgumentException: already added: Lcom/adwhirl/AdWhirlLayout$AdWhirlInterface;
       [dx]     at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
       [dx]     at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
       [dx]     at com.android.dx.command.dexer.Main.processClass(Main.java:486)
       [dx]     at com.android.dx.command.dexer.Main.processFileBytes(Main.java:455)
       [dx]     at com.android.dx.command.dexer.Main.access$400(Main.java:67)
       [dx]     at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:394)
       [dx]     at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
       [dx]     at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
       [dx]     at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
       [dx]     at com.android.dx.command.dexer.Main.processOne(Main.java:418)
       [dx]     at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
       [dx]     at com.android.dx.command.dexer.Main.run(Main.java:206)
       [dx]     at com.android.dx.command.dexer.Main.main(Main.java:174)
       [dx]     at com.android.dx.command.Main.main(Main.java:95)
       [dx] 1 error; aborting

现在我试图从主项目中删除的AdWhirl SDK lib和从库项目导出。现在Ant构建工作,但开始从日食任何Android设备上的应用程序时,会抛出一些ClassNotFoundExceptions。

Now i tried to remove the AdWhirl SDK lib from the main project and export it from the Library project. Now the ant build works, but when starting the application from eclipse on any android device, there will be thrown some ClassNotFoundExceptions.

其实我已经建立在Eclipse中蚂蚁或调试的选择,但我需要这两个变种。

Actually i have the choice to build with ant or debug in eclipse, but i need both variants.

推荐答案

从我的角度来看,Android的库项目是不是精心设计的,甚至从一开始,然而,这不能成为消费者开发一个真正的问题,只要它保持这样和行为的每个SDK升级期间完全相同。

From my point of view, Android Library Project is not well-designed even from the very beginning, however, this could not be a real problem for consumer developer, as long as it stays like this and behavior exactly the same during each SDK upgrade.

但它不是,Android的开发团队最近开始释放一些(可能是因为R14)在重整整个事情,并承诺在我们接下来会发布一个最终的解决方案。这使得我们不断发展的极其不稳定的阶段,此刻,我不使用蚂蚁和我的项目,但也有类似之类的使用Maven管理每个SDK升级过程中改变图书馆的问题。看起来像Android的开发团队甚至有困难纯粹的管理变化从他们的官方ADT插件(看看这个<一个href=\"http://android.foxykeep.com/dev/fix-the-conversion-to-dalvik-format-failed-with-error-1-with-adt-14\"相对=nofollow>博客),更不用说非官方支持的构建工具,如Ant或Maven。

But it is not, Android dev team started revamp the whole things during several recent release (probably since r14), and promise us a ultimate solution in next coming release. This leaves our continuous development in a extremely unstable stage at the moment, I don't use ant with my projects but had similar sort of problems using Maven manage library change during each SDK upgrade. Looks like Android Dev team even had difficulties manage the changes purely from their official ADT plugin (check out this blog), not to mention the un-official supported build tools like Ant or Maven.

我已经为你做一些搜索,有张贴在Android的JIRA系统中的线程这是相当类似于您的情况,并配备了一些解决方法(在Ant脚本脏修复),检查出的由克里斯·评论16,看看这可以帮助你。

I've done some search for you, there is a thread posted in Android JIRA system which is quite similar to your situation, and come with some workarounds (dirty fix in ant script), check out comments 16 by chris, see if this helps you out.

这篇关于SDK更新后,意外的顶级异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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