2013-10-25 55 views
0

我开始说“我讨厌月食”。昨天:我的项目进展顺利,没有任何错误。全部完美!好吧,我关闭了日食,关闭了我的电脑,我去睡觉了。今天:我开始我的日食和惊喜! 5个项目中有10000000个错误!所有说,当我通过鼠标移动MainActivity或其他活动;MainActivity类型的层次结构不一致。为什么?

The hierarchy of the type MainActivity is inconsistent

现在,我疯了,因为我需要这些项目!请任何人都可以帮我吗?这种情况非常令人讨厌。

编辑:看控制台我得到这个:

Found 2 versions of android-support-v4.jar in the dependency list, 
[2013-10-25 10:21:44 - AppTemplate] but not all the versions are identical (check is based on SHA-1 only at this time). 
[2013-10-25 10:21:44 - AppTemplate] All versions of the libraries must be the same at this time. 
[2013-10-25 10:21:44 - AppTemplate] Versions found are: 
[2013-10-25 10:21:44 - AppTemplate] Path: C:\Users\davide\Desktop\MyAppbattstats\libs\android-support-v4.jar 
[2013-10-25 10:21:44 - AppTemplate]  Length: 556198 
[2013-10-25 10:21:44 - AppTemplate]  SHA-1: 4a6be13368bb64c5a0b0460632d228a1a915f58f 
[2013-10-25 10:21:44 - AppTemplate] Path: C:\Users\davide\Desktop\SlidingMenu-master\library\libs\android-support-v4.jar 
[2013-10-25 10:21:44 - AppTemplate]  Length: 385685 
[2013-10-25 10:21:44 - AppTemplate]  SHA-1: 48c94ae70fa65718b382098237806a5909bb096e 
[2013-10-25 10:21:44 - AppTemplate] Jar mismatch! Fix your dependencies 
+0

清洁和重建一次。 –

+0

http://stackoverflow.com/questions/18459930/the-hierarchy-of-the-type-mainactivity-is-inconsistent – Batty

+0

尝试清理您的项目。 – VWeber

回答

2

您是否在使用第三方库或android v7 appcompat库,很多库都有android支持库的版本。现在您必须从项目的libs文件夹中移除android v4支持库,确保该库已添加到您的项目并再次编译。

Eclipse是一个简单的工具,可以为你管理很多事情,如果你不喜欢eclipse,你可以使用命令行和ant来创建Android应用程序。

看看你的控制台输出,它看起来像你正在使用SlidingMenu库。

1

由于错误说,你包括Android的支持库,android-support-v4.jar的两个版本。确保只包含一个。我将删除SlidingMenu库随附的jar,并使用libs文件夹内的jar。

编辑:这将导致您的100000错误,因为使用支持库的所有内容现在都会失败,并且所有内容也取决于此。可能是很多代码。

0

在我的情况下,在项目中添加v4支持库后,此错误消除。 转到项目属性>>构建java路径>>库>>浏览库android-support-v4.jar >> ok 然后清理项目。 错误删除

相关问题