属性" titleTextStyle"已定义? [英] Attribute "titleTextStyle" has already been defined?

查看:179
本文介绍了属性" titleTextStyle"已定义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我导入一个Eclipse Android项目到机器人工作室1.2.2 我的项目的摇篮:

 相关性{
    编制项目(':统一preferenceLib')
    编制项目(:viewPagerIndicatorLib)
    编制项目(:slidingUpFourSquare)
    编制项目(:stylishDialogLib)
    编制项目(:swipeListViewLib)
    编制项目(':库)
    编制项目(:textDrawLib)
    编制项目(:cardview)
    编制项目(:editTextFormLibrary)
    编译com.android.support:support-v4:22.2.0
    编译com.actionbarsherlock:actionbarsherlock:4.4.0@aar
    编译com.google.android.gms:播放服务:+
    编译文件(库/ CWAC-LocationPoller.jar)
    编译文件(库/解析-1.8.0.jar)
    编译文件(库/ ParseCrashReporting-1.8.0.jar)
    编译文件(库/ Android的支持 -  v13.jar)
    编译文件(库/ b​​lurnavdrawerlib.jar)
    编译文件(库/螺栓,Android的1.1.4.jar)
    编译文件(库/谷歌的HTTP客户端1.15.0-rc.jar)
    编译文件(库/谷歌的HTTP客户端的android-1.15.0-rc.jar)
    编译文件(库/谷歌的HTTP客户端jackson2-1.15.0-rc.jar)
    编译文件(库/ loremipsum-1.0.jar)
    编译文件(库/ Splunk的薄荷-4.0.8.jar)
    编译文件(库/ textdrawlib.jar)
}
 

我收到

  

错误:(1)属性titleTextStyle已经被定义

指着我colors.xml但我的xml文件甚至没有这个元素这样的属性。

解决方案

现在的问题是'com.actionbarsherlock:actionbarsherlock:4.4.0@aar 定义属性 titleTextStyle 这是在另一个库也被定义,因此冲突升高。

其他人的人有同样的问题,操作栏夏洛克加入后(<一href="http://stackoverflow.com/questions/23733021/error-after-adding-dependencies-to-action-bar-sherlock-in-android-studio-0-5-8">here和<一href="http://stackoverflow.com/questions/18745803/gradle-error-attribute-xxx-has-already-been-defined-in-android-studio">here)其中,appcompat-V7已经与相同功能的动作条(同一 titleTextStyle 属性也一样)。从appcompat-V7超过ActionBarSherlock使用动作条建议。

在你的情况appcompat V7不直接添加为一个依赖然而

这个答案

  

谷歌播放服务的最后一个版本,现在使用appcompat-V7,所以ü   不能与actionbarsherlock使用它。你必须只使用appcompat-V7   或播放服务的previous版本:

 编译com.google.android.gms:玩-服务:7.0.0
 

您正在使用最新的如此冲突appearead。你可以按照建议,仅使用appcompat还是坚持actionbarsherlock并切换到playservices版本7.0.0。

纵观 我注意到了Android支持库的功能,​​便能为:

  

在一般情况下,我们建议包括V4支持和V7 appcompat   图书馆,因为他们支持广泛的安卓版本和   对于建议的用户界面模式提供的API。

这是另一个迹象是不使用actionbarsherlock。

I have imported an eclipse android project into android studio 1.2.2 The gradle of my project:

dependencies {
    compile project(':unifiedPreferenceLib')
    compile project(':viewPagerIndicatorLib')
    compile project(':slidingUpFourSquare')
    compile project(':stylishDialogLib')
    compile project(':swipeListViewLib')
    compile project(':library')
    compile project(':textDrawLib')
    compile project(':cardview')
    compile project(':editTextFormLibrary')
    compile 'com.android.support:support-v4:22.2.0'
    compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
    compile 'com.google.android.gms:play-services:+'
    compile files('libs/CWAC-LocationPoller.jar')
    compile files('libs/Parse-1.8.0.jar')
    compile files('libs/ParseCrashReporting-1.8.0.jar')
    compile files('libs/android-support-v13.jar')
    compile files('libs/blurnavdrawerlib.jar')
    compile files('libs/bolts-android-1.1.4.jar')
    compile files('libs/google-http-client-1.15.0-rc.jar')
    compile files('libs/google-http-client-android-1.15.0-rc.jar')
    compile files('libs/google-http-client-jackson2-1.15.0-rc.jar')
    compile files('libs/loremipsum-1.0.jar')
    compile files('libs/splunk-mint-4.0.8.jar')
    compile files('libs/textdrawlib.jar')
}

I am getting

Error:(1) Attribute "titleTextStyle" has already been defined

pointing to my colors.xml but my xml file does not even have this element with such an attribute.

解决方案

The problem is 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar' defines the attribute titleTextStyle which is also defined in another library, thus the conflict rises.

Other people people have had the same problem with Action Bar Sherlock after adding it(here and here) where appcompat-v7 already had an actionbar with the same functionality (same titleTextStyle attribute as well). Using ActionBar from appcompat-v7 over ActionBarSherlock was recommended.

In your case appcompat v7 isn't directly added as a dependency however

As described in this answer

The last version of Google Play Services now uses appcompat-v7, so u can't use it with actionbarsherlock. You have to use only appcompat-v7 or the previous version of play services:

compile 'com.google.android.gms:play-services:7.0.0'

You were using the latest so the conflict appearead. You could, as suggested, use only appcompat or stick to actionbarsherlock and switch to playservices version 7.0.0.

Looking over the android support library features i noticed they guide you to:

In general, we recommend including the v4 support and v7 appcompat libraries, because they support a wide range of Android versions and provide APIs for recommended user interface patterns.

which is another indication as not to use actionbarsherlock.

这篇关于属性&QUOT; titleTextStyle&QUOT;已定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆