我看了这个 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'.
我尝试了四个库但给了我同样的错误。
答案 0 :(得分:2)
将其放入build.gradle的android {
部分:
dexOptions {
preDexLibraries = true
}
如果不起作用,请尝试删除已在子项目中声明的库。例如,如果任何子项目具有“appcompat”依赖项并且您在主项目中声明了一个 - 删除主项目中的“appcompat”依赖项。