【问题标题】:conflicting appcompat-v7 with other dependenciesappcompat-v7 与其他依赖项冲突
【发布时间】:2015-05-15 19:26:23
【问题描述】:

我读过这个 Error after adding dependencies to Action Bar Sherlock in Android Studio 0.5.8 但没有帮助我。

我在 github 中找到了几个 android 自定义对话框库。 但是当我将每一个都包含在依赖项中时,gradle 给了我错误:

Warning:string 'abs__activity_chooser_view_dialog_title_default' has no default translation.
Warning:string 'abs__share_action_provider_share_with' has no default translation.
F:\Work\workspace\NITask\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\21.0.3\res\values\values.xml
Error:Attribute "titleTextStyle" has already been defined
Error:Attribute "subtitleTextStyle" has already been defined
Error:Attribute "divider" has already been defined
Error:Attribute "background" has already been defined
Error:Attribute "backgroundSplit" has already been defined
Error:Attribute "navigationMode" has already been defined
Error:Attribute "displayOptions" has already been defined
Error:Attribute "title" has already been defined
Error:Attribute "subtitle" has already been defined
Error:Attribute "icon" has already been defined
.
.
.
.
Error:Attribute "dropDownListViewStyle" has already been defined
Error:Attribute "listPopupWindowStyle" has already been defined
Error:Attribute "textAppearanceListItemSmall" has already been defined
Error:Execution failed for task ':app:processDebugResources'.

我尝试了四个库,但给了我同样的错误。

【问题讨论】:

    标签: android gradle


    【解决方案1】:

    将其放入 build.gradle 的 android { 部分:

    dexOptions {
        preDexLibraries = true
    }
    

    如果这不起作用,请尝试删除已在子项目中声明的库。例如,如果任何子项目具有“appcompat”依赖项并且您在主项目中声明了一个 - 请删除主项目中的“appcompat”依赖项。

    【讨论】:

    • dexOptions 对我不起作用。我在子模块已经拥有的某些模块中删除了 appcompat。没有错误了。 tnx @Demonick
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-12-18
    • 2019-09-02
    • 2018-11-10
    • 1970-01-01
    • 2016-01-12
    • 2016-11-05
    • 2019-08-08
    相关资源
    最近更新 更多