Gildas
Gildas

Reputation: 758

Using ActionBar Sherlock with intellij through maven. @style/Theme.Sherlock in AndroidManifest.xml does not match

Just trying the simplest thing to use ActionBar Sherlock in an Android app using IntelliJ 12.

I've read in other post and blogs and people keep dowloading ABS' source and mavenizing it ( complaining ABS on maven is too old). It turns out on maven we can get 4.3.1 now.

Therefore, I am trying to avoid mavenizing ABS again.

So, I created a blank Android app project with a simple Hello, World activity. Compiled and ran it, just to be sure.

Then, I went to the Project Structure and added the ABS library via Maven (com.actionbarsherlock:actionbarsherlock:4.3.1). Added it to the Module that represents my app. Made sure to mark the library as "Provided" in the Module Dependencies.

The whole thing compiles and run.

Of course, as soon as I extend the main activity from SherlockActivity the app crashes. Expected...

So, I open the AndroidManifest.xml and add android:theme="" to the application tag.

To my surprise and pain, @style/Theme.Sherlock... does not auto-complete, and the compiler complains with the dreaded error:

Error: No resource found that matches the given name (at 'theme' with value '@style/Theme.Sherlock')

So, my question is what did I miss? Is there a way to ask IntelliJ to load the resources from ABS?

Thanks.

Upvotes: 2

Views: 932

Answers (1)

CrazyCoder
CrazyCoder

Reputation: 402235

Adding ActionBarShelock as a library (plain jar) will not work, you have to configure it as a Library module in IntelliJ IDEA and then set your main module to depend on it. See this tutorial.

Upvotes: 3

Related Questions