Attribute “titleTextStyle” has already been defined?

后端 未结 1 417
借酒劲吻你
借酒劲吻你 2020-12-09 15:44

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

dependencies {
    compile project(\':unifiedPreferenceLib\')
         


        
相关标签:
1条回答
  • 2020-12-09 16:32

    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.

    0 讨论(0)
提交回复
热议问题