简体   繁体   English

如何在 Android 应用程序中使用 Gradle 导入 ActionBarSherlock?

[英]How to import ActionBarSherlock using Gradle in Android app?

I'm trying to import ActionBarSherlock (ABS) into my Android app using Gradle, but unfortunately, when building I get a list of errors saying:我正在尝试使用 Gradle 将 ActionBarSherlock (ABS) 导入到我的 Android 应用程序中,但不幸的是,在构建时,我收到了一个错误列表:

/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'

I'm trying to import ABS using the following in build.gradle :我正在尝试使用build.gradle 中的以下内容导入 ABS:

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'))
}

and in my settings.gradle I've got the following line:在我的settings.gradle 中,我有以下几行:

include ':OurPackage', ':Libraries:ActionBarSherlock'

Does anybody know what I'm doing wrong?有谁知道我做错了什么? All tips are welcome!欢迎所有提示!

The same attributes titleTextStyle , subtitleTextStyle , divider , background are defined in 2 different libraries.在 2 个不同的库中定义了相同的属性titleTextStylesubtitleTextStyledividerbackground

The 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar' and the support library 'com.android.support:support-v4:18.0.+' which introduced the v7 appcompat library can't work together. 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'和引入 v7 appcompat 库的支持库'com.android.support:support-v4:18.0.+'不能一起工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用gradle导入依赖项 - How to import dependencies using gradle Android,如何将Gradle库导入eclipse(ANT) - Android, how to import Gradle library into eclipse (ANT) 如何在React Native中导入Android Gradle依赖项 - How to import Android gradle dependencies in React Native Gradle Error无法在Android Studio中找到com.actionbarsherlock:actionbarsherlock:4.4.0与Eclipse导出的项目 - Gradle Error Could not find com.actionbarsherlock:actionbarsherlock:4.4.0 with Eclipse exported project in Android Studio 无法在IntelliJ或Android Studio中成功导入应用程序资源的Gradle - Gradle import of app resources not successful in IntelliJ or Android Studio 如何使用Intellij将Windows的Android Gradle项目从Windows导入到Linux而不出现密钥库问题 - How to Import an Android Gradle Project from Windows to Linux using Intellij without getting keystore issues 如何在Android中的actionbarsherlock中使用简单按钮? - how to work with simple button in actionbarsherlock in android? 如何导入 gradle 依赖项 - How to import a gradle dependency 如何在 gradle 项目中导入 javax.validation(用于使用 @Valid) - How to import javax.validation(for using @Valid) in gradle project 如何使用 Gradle 导入 o​​rg.apache.httpcomponents - How to import org.apache.httpcomponents using Gradle
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM