7

I've a problem using ABS with Maven. I added ABS support in my POM in the following way:

 <dependencies>
   <dependency>
        <groupId>com.google.android</groupId>
        <artifactId>android</artifactId>
        <version>4.0.1.2</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>com.google.android</groupId>
        <artifactId>support-v4</artifactId>
        <version>r10</version>
    </dependency>       

    <dependency>
      <groupId>com.actionbarsherlock</groupId>
      <artifactId>library</artifactId>
      <version>4.2.0</version>
      <type>apklib</type>
      <exclusions>
          <exclusion>
            <groupId>com.google.android</groupId>
            <artifactId>support-v4</artifactId>
          </exclusion>
        </exclusions>
    </dependency>

    <dependency>
      <groupId>com.actionbarsherlock</groupId>
      <artifactId>library</artifactId>
      <version>4.2.0</version>
      <type>jar</type>
      <exclusions>
          <exclusion>
            <groupId>com.google.android</groupId>
            <artifactId>support-v4</artifactId>
          </exclusion>
        </exclusions>
    </dependency>
</dependencies>

My Sourcecode compiles fine, but I can't add the ABS Theme because no ABS Theme is available. I tried to add the Theme in the following way:

 <application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
            android:theme="@android:style/Theme.Sherlock" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

This produces an error "No resources found that matches the given name".

What should I do to add the ABS Themes?

Thanks in advance, Mirco

user1537678
  • 153
  • 1
  • 4

2 Answers2

0

Use @style/Theme.Sherlock instead of @android:style/Theme.Sherlock.

http://developer.android.com/guide/topics/ui/themes.html#ApplyATheme

This post may also be helpful:

Setting ActionBarSherlock Theme for Android app

Community
  • 1
  • 1
blackcj
  • 3,651
  • 2
  • 25
  • 23
0

Can I assume you are using Android Studio? If so this site helped me out and now I base all my apps on this method: ABS and Android Studio It works every time for me with a little modification:

    1. You don't have to fork ABS from its Git repo, just get the zip from ActionBarSherlock.com
    2. create a libraries folder and then a subfolder `ActionBarSherlock`, extract everything from the zip into \libraries\ActionBarSherlock
    3. create/edit the build.gradle files as mentioned in the guide.

Android Studio will constantly throw errors at you as you modify the files and it tries to keep compiling them as you go.. just keep going to the end.

Mark
  • 55
  • 2
  • 10