属性"titleTextStyle"已经定义?

Nez*_*zam 26 android

我已经将eclipse android项目导入android studio 1.2.2我的项目的gradle:

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')
}
Run Code Online (Sandbox Code Playgroud)

我正进入(状态

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

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

Lau*_* L. 29

问题是'com.actionbarsherlock:actionbarsherlock:4.4.0@aar' 定义属性titleTextStyle,该属性也在另一个库中定义,因此冲突上升.

其他人在添加它(此处此处)之后与Action Bar Sherlock有同样的问题,其中appcompat-v7已经有一个具有相同功能的动作栏(同样的titleTextStyle属性).建议使用appcompat-v7中的ActionBar而不是ActionBarSherlock.

在您的情况下,appcompat v7不会直接添加为依赖项

本答案所述

最新版本的Google Play服务现在使用appcompat-v7,因此您无法将其与actionbarsherlock一起使用.您只能使用appcompat-v7或以前版本的播放服务:

compile 'com.google.android.gms:play-services:7.0.0'
Run Code Online (Sandbox Code Playgroud)

你正在使用最新的冲突外观.您可以按照建议仅使用appcompat或坚持使用actionbarsherlock并切换到playservices 7.0.0版.

查看android支持库的功能,我注意到它们会引导您:

通常,我们建议包括v4支持和v7 appcompat库,因为它们支持广泛的Android版本并为推荐的用户界面模式提供API.

这是另一个表示不使用actionbarsherlock的指示.

  • 编译'com.google.android.gms:play-services:7.0.0'解决了这个问题,谢谢! (2认同)