问题描述
我正在尝试使用Gradle将ActionBarSherlock(ABS)导入我的Android应用程序,但是不幸的是,在构建时,我收到了以下错误列表:
I'm trying to import ActionBarSherlock (ABS) into my Android app using Gradle, but unfortunately, when building I get a list of errors saying:
/Users/kramer65/dev/repos/android-official/OurPackage/build/res/all/debug/values/values.xml:248: error: Attribute "titleTextStyle" has already been defined
/Users/kramer65/dev/repos/android-official/OurPackage/build/res/all/debug/values/values.xml:250: error: Attribute "subtitleTextStyle" has already been defined
/Users/kramer65/dev/repos/android-official/OurPackage/build/res/all/debug/values/values.xml:256: error: Attribute "divider" has already been defined
/Users/kramer65/dev/repos/android-official/OurPackage/build/res/all/debug/values/values.xml:258: error: Attribute "background" has already been defined
[etc. etc.]
* What went wrong:
Execution failed for task ':processDebugResources'.
> Could not call IncrementalTask.taskAction() on task ':processDebugResources'
我正在尝试使用 build.gradle 中的以下内容导入ABS:
I'm trying to import ABS using the following in build.gradle:
dependencies {
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
compile 'com.android.support:support-v4:18.0.+'
compile 'com.google.android.gms:play-services:4.0.30'
instrumentTestCompile(files('libs/espresso-1.0-SNAPSHOT-bundled.jar'))
}
,在我的 settings.gradle 中,有以下一行:
and in my settings.gradle I've got the following line:
include ':OurPackage', ':Libraries:ActionBarSherlock'
有人知道我在做什么错吗?欢迎所有提示!
Does anybody know what I'm doing wrong? All tips are welcome!
推荐答案
在2个不同的库中定义了相同的属性titleTextStyle
,subtitleTextStyle
,divider
,background
.
The same attributes titleTextStyle
, subtitleTextStyle
, divider
, background
are defined in 2 different libraries.
'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
和支持库 'com.android.support:support-v4:18.0.+'
引入了v7 appcompat库无法一起使用.
这篇关于如何在Android应用中使用Gradle导入ActionBarSherlock?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!