5

Though i have imported and added ActionBar Sherlock to my project, I am not able to compile the project. I get the following error:

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

How do I solve this?? Please help...

Ahmad
  • 69,608
  • 17
  • 111
  • 137
Sudeep
  • 53
  • 1
  • 4
  • I am having the same problem after following the guides on SO (http://stackoverflow.com/questions/16588064/how-do-i-add-a-library-project-to-the-android-studio and http://stackoverflow.com/questions/16577580/problems-importing-project-into-android-studio-regarding-actionbarsherlock). The IDE recognized the reference to ABS, but the resources can not be found while building the application. [Screenshot](http://i.imgur.com/3yQzRbZ.png). – christiaanderidder May 19 '13 at 12:12
  • 1
    I had the same problem, check this answer! [http://stackoverflow.com/questions/16588064/how-do-i-add-a-library-project-to-the-android-studio][1] [1]: http://stackoverflow.com/questions/16588064/how-do-i-add-a-library-project-to-the-android-studio – mintypa May 21 '13 at 08:52

1 Answers1

2

There is some bug in Android Studio which doesn't handle library dependencies well while exporting gradle file. You can manually edit library dependencies by any one of the following method.

1) For instance, given to following structure:

MyProject/

  • app/
  • libraries/
    • lib1/
    • lib2/

We can identify 3 projects. Gradle will reference them with the following name:

  1. :app
  2. :libraries:lib1
  3. :libraries:lib2

The :app project is likely to depend on the libraries, and this is done by declaring the following dependencies:

dependencies {
    compile project(':libraries:lib1')
}

2) Or you do do File -> Project Structure -> Modules There you will find dependencies tab, Click on it and manually add libraries by pressing on "+" button.

For Sherlock, may be you want to delete their test directory, or add the junit.jar file to the classpath

Shakti Malik
  • 2,335
  • 25
  • 32