Android的地塞米松:意外的顶级例外:已加入 [英] Android Dex: UNEXPECTED TOP-LEVEL EXCEPTION: Already added

查看:105
本文介绍了Android的地塞米松:意外的顶级例外:已加入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序依赖于库项目。这个库项目依赖于Android的兼容包V4。我有不会导出库项目的依赖。在我自己的项目,我已经添加ACL V13作为依赖,但在编译的时候,我得到了本质上有一个重复的依赖性错误。我想过没有导出库项目的依赖会解决这个问题,但它不是。

My app depends on a library project. This library project depends on the Android Compatibility Package V4. I have NOT exported the library project's dependency. In my own project, I've added ACL V13 as a dependency, but when compiling I get the error that essentially there's a duplicate dependency. I thought not exporting the library project's dependency would resolve this issue, but it's not.

我该如何解决此问题?

修改

此外,根据安卓工具文档

特殊情况下Android的支持,v4.jar和Android支持-v13.jar。

Special case for android-support-v4.jar and android-support-v13.jar.

我们做了这两个库的一个特例,因为-v13包含   完整版-v4内。如果两者都找到,则仅-v13将   用了。

We make a special case for these two libraries because -v13 contains a full version of -v4 inside. If both are found, then only -v13 will be used.

因此​​,它应该只是工作...

So it should just work...

推荐答案

如果您使用在不同项目(库项目或标准项目)一模一样的lib瓶子,APK工具得到自动去掉重复的。

If you use exactly the same lib jar in different projects (libs project or standard projects), the apk tools get rid automatically of the duplicate ones.

当你有两个库具有相同的名称,但不能在同一版本的问题开始。

The problem starts when you have two libs with the same name but not at the same revision.

Android的支持,v4.jar和Android支持-v13.jar文件,可以从不同的版本,因为那里总是有不同的支持包版本相同的名称(<一href="http://developer.android.com/tools/extras/support-library.html#Notes">http://developer.android.com/tools/extras/support-library.html#Notes)

The android-support-v4.jar and android-support-v13.jar files can be from different revision since there always have the same name in different support package release (http://developer.android.com/tools/extras/support-library.html#Notes)

我会检查你使用的支持库一模一样的版本在你的主项目,并在你的lib项目。

I would check that you use exactly the same revision of the support libs in your main project and in your lib project.

要确保,复制两个支持库罐(位于 Android的SDK 文件夹)到项目的库文件夹。

To make sure, copy the two support libraries jars (located in the android-sdk folder) to your projects libs folder.

{android-sdk}/extras/android/support/v4/android-support-v4.jar
AND
{android-sdk}/extras/android/support/v13/android-support-v13.jar

这应该摆脱这个问题。

It should get rid of the problem.

这篇关于Android的地塞米松:意外的顶级例外:已加入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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