user1939358
user1939358

Reputation:

Android Studio: Theme.Sherlock.Light.DarkActionBar cannot be resolved

I have included the ABS aar, as seen here (https://github.com/JakeWharton/ActionBarSherlock-Gradle-Sample), in my project. It works fine with my classes, in my style XML, however, I get "Theme.Sherlock.Light.DarkActionBar cannot be resolved". My gradle file looks like this:

dependencies {
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
compile 'com.android.support:support-v4:18.0.+'
}

In my style XML:

 <style name="AppTheme" parent="Theme.Sherlock.Light.DarkActionBar">
    <item name="textAppearanceFinish">@style/TextAppearanceFinish</item>
 </style>

What am I doing wrong?

Upvotes: 8

Views: 3338

Answers (2)

Rakesh
Rakesh

Reputation: 1035

Why you are using Theme.Sherlock.Light.DarkActionBar. You can implement this by android support library appcompact v7 that is stable and does not create any problem easy to use. you can do this by changing your code like

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="textAppearanceFinish">@style/TextAppearanceFinish</item>
 </style>

and in your gradle dependency

dependencies {
compile fileTree(include: '*.jar', dir: 'libs')
compile 'com.android.support:appcompat-v7:22.0.0'

}

Upvotes: 2

Godfred
Godfred

Reputation: 91

First of I presume that the ABS classes are rightly resolved in your IDE (i.e. they are not marked in red), since you don't mention it.

If you are using Android Studio < 0.4.3, there is a known bug (fixed in 0.4.3) where dependencies in the build scripts are not fully resolved. You can check if Your_Project/your_module/build/exploded-bundles/ComActionbarsherlock.../classes.jar exists. If not then the fix is in a few steps in this stackoverflow thread.

Upvotes: 0

Related Questions