任务':app:processDebugResources'的Android Studio执行失败。

时间:2016-05-02 14:46:52

标签: java android android-studio android-gradle build.gradle

当我尝试构建项目时,Messages Gradle Build会报告以下消息:

C:\...\src\main\res\values-v14\styles_app.xml
Error:(26, 5) Resource entry Theme.App already has bag item android:windowBackground.
Error:(26, 5) Originally defined here.
C:\...\build\intermediates\res\merged\debug\values\values.xml
Error:(233) Attribute "titleTextStyle" has already been defined
Error:(233) Attribute "subtitleTextStyle" has already been defined
Error:(233) Attribute "divider" has already been defined
Error:(233) Attribute "background" has already been defined
Error:(233) Attribute "backgroundSplit" has already been defined
Error:(261) Attribute "navigationMode" has already been defined
Error:(261) Attribute "displayOptions" has already been defined
Error:(261) Attribute "title" has already been defined
Error:(261) Attribute "subtitle" has already been defined
Error:(261) Attribute "icon" has already been defined
Error:(261) Attribute "logo" has already been defined
Error:(261) Attribute "backgroundStacked" has already been defined
Error:(261) Attribute "customNavigationLayout" has already been defined
Error:(261) Attribute "homeLayout" has already been defined
Error:(261) Attribute "progressBarStyle" has already been defined
Error:(261) Attribute "indeterminateProgressStyle" has already been defined
Error:(261) Attribute "progressBarPadding" has already been defined
Error:(261) Attribute "itemPadding" has already been defined
Error:(264) Attribute "initialActivityCount" has already been defined
Error:(264) Attribute "expandActivityOverflowButtonDrawable" has already been defined
Error:(267) Attribute "preserveIconSpacing" has already been defined
Error:(268) Attribute "iconifiedByDefault" has already been defined
Error:(268) Attribute "queryHint" has already been defined
Error:(276) Attribute "track" has already been defined
Error:(276) Attribute "thumbTextPadding" has already been defined
Error:(276) Attribute "switchTextAppearance" has already been defined
Error:(276) Attribute "switchMinWidth" has already been defined
Error:(276) Attribute "switchPadding" has already been defined
Error:(279) Attribute "windowActionBar" has already been defined
Error:(279) Attribute "windowNoTitle" has already been defined
Error:(279) Attribute "windowActionBarOverlay" has already been defined
Error:(279) Attribute "windowActionModeOverlay" has already been defined
Error:(279) Attribute "windowMinWidthMajor" has already been defined
Error:(279) Attribute "windowMinWidthMinor" has already been defined
Error:(279) Attribute "actionBarTabStyle" has already been defined
Error:(279) Attribute "actionBarTabBarStyle" has already been defined
Error:(279) Attribute "actionBarTabTextStyle" has already been defined
Error:(279) Attribute "actionOverflowButtonStyle" has already been defined
Error:(279) Attribute "actionBarStyle" has already been defined
Error:(279) Attribute "actionBarSplitStyle" has already been defined
Error:(279) Attribute "actionBarWidgetTheme" has already been defined
Error:(279) Attribute "actionBarSize" has already been defined
Error:(279) Attribute "actionBarDivider" has already been defined
Error:(279) Attribute "actionBarItemBackground" has already been defined
Error:(279) Attribute "actionMenuTextAppearance" has already been defined
Error:(279) Attribute "actionMenuTextColor" has already been defined
Error:(279) Attribute "actionModeStyle" has already been defined
Error:(279) Attribute "actionModeCloseButtonStyle" has already been defined
Error:(279) Attribute "actionModeBackground" has already been defined
Error:(279) Attribute "actionModeSplitBackground" has already been defined
Error:(279) Attribute "actionModeCloseDrawable" has already been defined
Error:(279) Attribute "actionModeShareDrawable" has already been defined
Error:(279) Attribute "actionModePopupWindowStyle" has already been defined
Error:(279) Attribute "textAppearanceLargePopupMenu" has already been defined
Error:(279) Attribute "textAppearanceSmallPopupMenu" has already been defined
Error:(279) Attribute "actionDropDownStyle" has already been defined
Error:(279) Attribute "dropdownListPreferredItemHeight" has already been defined
Error:(279) Attribute "spinnerDropDownItemStyle" has already been defined
Error:(279) Attribute "homeAsUpIndicator" has already been defined
Error:(279) Attribute "actionButtonStyle" has already been defined
Error:(279) Attribute "selectableItemBackground" has already been defined
Error:(279) Attribute "dividerVertical" has already been defined
Error:(279) Attribute "activityChooserViewStyle" has already been defined
Error:(279) Attribute "popupMenuStyle" has already been defined
Error:(279) Attribute "textAppearanceSearchResultTitle" has already been defined
Error:(279) Attribute "textAppearanceSearchResultSubtitle" has already been defined
Error:(279) Attribute "textColorSearchUrl" has already been defined
Error:(279) Attribute "listPreferredItemHeightSmall" has already been defined
Error:(279) Attribute "listPreferredItemPaddingLeft" has already been defined
Error:(279) Attribute "listPreferredItemPaddingRight" has already been defined
Error:(279) Attribute "dropDownListViewStyle" has already been defined
Error:(279) Attribute "listPopupWindowStyle" has already been defined
Error:(279) Attribute "textAppearanceListItemSmall" has already been defined
Error:(279) Attribute "buttonStyleSmall" has already been defined
C:\...\build\intermediates\res\merged\debug\values-v23\values-v23.xml
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(18) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\android-sdk-windows\build-tools\23.0.3\aapt.exe'' finished with non-zero exit value 1

相应地在Gradle控制台中报告:

 AGPBI: {"kind":"error","text":"Resource entry Theme.app already has bag item android:windowBackground.","sources":[{"file":"C:\\...\\src\\main\\res\\values-v14\\styles_app.xml","position":{"startLine":25,"startColumn":4,"startOffset":1049,"endLine":39,"endColumn":10,"endOffset":2401}}],"original":"","tool":"AAPT"}
.
    .
FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\android-sdk-windows\build-tools\23.0.3\aapt.exe'' finished with non-zero exit value 1

问题是什么?

注意:此处报告的问题Android: Execution failed for task ':app:processDebugResources'没有解决方案。

1 个答案:

答案 0 :(得分:1)

我找到了解决方案:

1)消除android:windowBackground重复的表单值-v14 \ styles_app.xml;

2)如在不同的线程中找到的,如果你使用“actionBarSherlock”库,你不应该使用appCompact v7,所以你需要在build.gradle项目中设置7.0.0版本的play-services,因为这个是最后一个版本不包含它。

3)在项目清单文件中,您必须设置:

4)librarySlidingMenu gradle文件中的minSdkVersion版本不得低于Sherlocks库Manifest文件中设置的版本。