【问题标题】:Android Studio Execution failed for task ':app:processDebugResources'.任务“:app:processDebugResources”的Android Studio 执行失败。
【发布时间】:2016-08-27 09:16:52
【问题描述】:

当我尝试构建我的项目时,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 Console 中报告:

 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' 此处报告的问题没有解决方案。

【问题讨论】:

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


    【解决方案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 文件中设置的版本。

    【讨论】:

    • Point: 2 是我的解决方案。你刚刚救了一条命(y)
    猜你喜欢
    • 2015-08-27
    • 2016-05-05
    • 2021-04-28
    • 2023-04-08
    • 1970-01-01
    • 2015-02-08
    • 2019-08-16
    • 2016-08-04
    • 2017-07-23
    相关资源
    最近更新 更多