在android studio中构建android项目时出现错误

问题描述:

 
Error:(210) Attribute "background" already defined with incompatible format. 
Error:(64) Original attribute defined here. 
Error:(237) Attribute "navigationMode" already defined with incompatible format. 
Error:(210) Original attribute defined here. 
Error:(210) Original attribute defined here. 
Error:(237) Attribute "displayOptions" already defined with incompatible format. 
Error:(246) Attribute "actionBarSize" already defined with incompatible format. 
Error:(220) Original attribute defined here. 
Error:(246) Attribute "windowMinWidthMajor" already defined with incompatible format. 
Error:(220) Original attribute defined here. 
Error:(246) Attribute "windowMinWidthMinor" already defined with incompatible format. 
Error:(220) Original attribute defined here. 
Error:Execution failed for task ':app:processDebugResources'. 
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/gumbi/Android/Sdk/build-tools/24.0.0/aapt'' finished with non-zero exit value 1 

例如错误:(237)属性“displayOptions”已用不兼容的格式定义。 在陆续上马:在android studio中构建android项目时出现错误

<declare-styleable name="SherlockActionBar"> 
    <attr name="navigationMode"> 
     <enum name="normal" value="0"/> 
     <enum name="listMode" value="1"/> 
     <enum name="tabMode" value="2"/> 
    </attr> 
    <attr name="displayOptions"> 
     <flag name="useLogo" value="0x1"/> 
     <flag name="showHome" value="0x2"/> 
     <flag name="homeAsUp" value="0x4"/> 
     <flag name="showTitle" value="0x8"/> 
     <flag name="showCustom" value="0x10"/> 
     <flag name="disableHome" value="0x20"/> 
    </attr> 
    <attr name="title" format="string"/> 
    <attr name="subtitle" format="string"/> 
    <attr name="titleTextStyle"/> 
    <attr name="subtitleTextStyle"/> 
    <attr name="icon" format="reference"/> 
    <attr name="logo" format="reference"/> 
    <attr name="divider"/> 
    <attr name="background"/> 
    <attr name="backgroundStacked" format="reference|color"/> 
    <attr name="backgroundSplit"/> 
    <attr name="customNavigationLayout" format="reference"/> 
    <attr name="height"/> 
    <attr name="homeLayout" format="reference"/> 
    <attr name="progressBarStyle" format="reference"/> 
    <attr name="indeterminateProgressStyle" format="reference"/> 
    <attr name="progressBarPadding" format="dimension"/> 
    <attr name="itemPadding" format="dimension"/> 
</declare-styleable> 
+0

任何提示.. ??请 –

+0

你可以[编辑]你的问题,包括更多的文字。意见是为了回复其他人 –

+0

把你的代码,你尝试过呢。 – KrishnaJ

您正在使用的已被废弃,将导致建立一个与Android的最新构建工具和支持库错误actionbarsherlock。

您必须从您的项目中删除com.actionbarsherlock:actionbarsherlock,并改用com.android.support:appcompat。它可能需要一些重构,但将需要完成以支持Android 6(ActionbarSherlock导致构建错误和Android 6及更高版本的崩溃)

如果您不需要支持最新版本的Android,您可以总是降级你的构建工具和支持库,但我不会推荐这个。

+0

冲突感谢..我应该尝试这个 –

+0

我可以用在这个项目actionbarsherlock以及.. –

+0

你会没有再使用它的优势了。 AppCompat具有ActionbarSherlock所需的全部功能。 ActionbarSherlock将导致运行Android 6或更高版本的设备发生崩溃。 – MrJM