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

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

问题描述

我已经将一个eclipse的android项目导入到android studio 1.2.2
我的项目毕业:

  
编译项目(':
编译项目(':swipeListViewLib')
编译项目(':library')
编译项目(':textDrawLib')
编译项目(':cardview')
compile project(':editTextFormLibrary')
compile'c​​om.android.support:support-v4:22.2.0'
compile'c​​om.actionbarsherlock:actionbarsherlock:4.4.0@aar'
compile'c​​om.google.android.gms:play-services:+'
编译文件('libs / CWAC-LocationPoller.jar')
编译文件('libs / Parse-1.8.0 .jar')
编译文件('libs / ParseCrashReporting-1.8.0.jar')
编译文件('libs / android-su pport-v13.jar')
编译文件('libs / blurnavdrawerlib.jar')
编译文件('libs / bolt-android-1.1.4.jar')
编译文件'lib / google-http-client-1.15.0-rc.jar')
编译文件('libs / google-http-client-android-1.15.0-rc.jar')
compile文件('libs / google-http-client-jackson2-1.15.0-rc.jar')
编译文件('libs / loremipsum-1.0.jar')
编译文件('libs / splunk -mint-4.0.8.jar')
编译文件('libs / textdrawlib.jar')
}

我正在获得


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


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

解决方案

问题是'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
定义属性 titleTextStyle whi在另一个图书馆中也定义了ch,因此冲突升高。



其他人在添加之后与Action Bar Sherlock有相同的问题(此处其中)其中appcompat-v7已经有一个动作栏相同的功能(相同的 titleTextStyle 属性)。建议使用ActionBar从Appcompat-v7上使用ActionBarSherlock。



在您的情况下,appcompat v7不直接添加为依赖关系,但



这个答案


最后一个版本的Google Play Services现在使用appcompat-v7,所以u
不能用actionbarsherlock使用它。您只能使用appcompat-v7
或以前版本的播放服务:

 编译'com.google。 android.gms:play-services:7.0.0'


你正在使用最新的冲突appearead。您可以建议,只能使用appcompat或stick to actionbarsherlock并切换到7.0.0的playservices。



查看 android支持库功能我注意到他们指导你:


一般来说,我们建议您包括v4支持和v7 appcompat
库,因为它们支持各种Android版本,而
提供了推荐的用户界面模式的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 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.

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

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