![](/img/trans.png)
[英]After reinstalling Android Studio have an error while build project
[英]getting error while build android project in android studio
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”已使用不兼容的格式定义。 排成一行:
<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>
您正在使用的actionbarsherlock已过时,它将导致使用最新的android构建工具和支持库导致构建错误。
您将不得不从项目中删除com.actionbarsherlock:actionbarsherlock
,而改用com.android.support:appcompat
。 它可能需要进行一些重构,但是为了支持Android 6,需要做一些修改(ActionbarSherlock会导致构建错误并从Android 6及更高版本崩溃)
如果您不需要支持最新版本的Android,则可以随时将构建工具降级并支持lib,但我不建议这样做。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.