READ UPDATE 2 BELOW FOR THE ANSWER
I\'m trying to use ActionBarSherlock in my app. I checked out the 4.0.0 release from the project github repo, bui
For me this was caused by not using the @style/
prefix. I.e. I had
<style name="AppTheme" parent="Theme.Sherlock.Light" />
instead of
<style name="AppTheme" parent="@style/Theme.Sherlock.Light" />
Which is kind of weird because I swear the default template value is something like:
<style name="AppTheme" parent="android:Theme.Holo.Light" />
This was happening to me in IntelliJ IDEA. I solved this issue by going to File > Project Structure > Project Settings > Facets > Select actionbarsherlock module in 2nd column > Check the "Library module" checkbox > Apply and OK > Save and Rebuild.
UPDATE After further review, my original response may be too specific, and will probably only work in certain cases. This error means that the dependencies have not been properly setup. In IntelliJ IDEA, follow these steps to properly setup actionbarsherlock as a module dependency:
That should do the trick.
Usually, you set your theme in the manifest, as shown in the Android developer documentation (and linked to from the ActionBarSherlock theming page).
If you want to use ActionBarSherlock everywhere within your app, this works:
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Sherlock">
If you wanna use custom style, I made a template for custom ActionBarSherlock style. Theme is defined in /values/styles.xml file. It is extended from Theme.Sherlock.Light theme. There are many parameters, you can set: icon, logo, divider, title, shadow overlay, action menu buttons, popup menu, action mode background, dropdown list navigation, tab style, display options etc. Almost everything, what you need, to create your custom action bar theme. I use this template in my apps, because it helps me to style action bar very quickly.
You can find this template on my GitHub. It is very easy to use. Just copy values and drawable directiories into your project and set android:theme parameter in application element in AndroidManifest.xml:
<application
...
android:theme="@style/Theme.Example">
Drawables in my template were generated via Android Action Bar Style Generator. I use different naming convention for resources. This simple script renames all resources generated with Android Action Bar Style Generator to my own convention, used in the template.
Had the same problem. The app crashed altough the theme was set in the manifest. Setting the theme programmatically solved the problem:
@Override
protected void onCreate(Bundle savedInstanceState) {
setTheme(R.style.AppTheme);
super.onCreate(savedInstanceState);
<!--Provides resources-->
<dependency>
<groupId>com.actionbarsherlock</groupId>
<artifactId>library</artifactId>
<version>4.1.0</version>
<type>apklib</type>
</dependency>
<!-Provides import links-->
<dependency>
<groupId>com.actionbarsherlock</groupId>
<artifactId>library</artifactId>
<version>4.1.0</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
The hint is to use type "apklib", that's mean that maven will be using all sources (resources too). Other dependecy to jar file (scope "provided") is used to achieve link to sherlock classes during coding.