简体   繁体   中英

Android-Studio: Gradle doesn't find HoloEverywhere

After hours of fighting with android-studio and HoloEverywhere+ActionBarSherlock, I finally managed to set everything up; The holoeverywhere classes are found in android-studio. However, upon "Make" or "Compile" of my project, I am getting the following errors:

Gradle: Error retrieving parent for item: No resource found that matches the given name 'Holo.Theme'.
Gradle: No resource found that matches the given name: attr 'actionBarSize'.
Gradle: Error retrieving parent for item: No resource found that matches the given name 'Holo.Theme.Light'.
Gradle: No resource found that matches the given name: attr 'actionBarSize'.

Now, in my themes.xml file, I create some styles that inherit from Holo.Theme and Holo.Theme.Light . It did work in Eclipse, and since HoloEverywhere seems to be found and is added as a dependency of my project, why does gradle not find these definitions?

The code is, as usual:

<style name="MyTheme" parent="Holo.Theme.Light">
...
    <item name="actionBarSize">48dip</item>
    <item name="android:actionBarSize">48dip</item>
...
</style>

Thank you for your help!


By the way, the styles are found by android-studio, since it doesn't complain in the editor. Only when I make or compile, these errors appear.


Another thing, which may help: I tried removing the HoloEverywhere Stuff from the xml, and compile, and gradle also complained about the Java classes. So, it appears as if gradle doesn't find anything of HoloEverywhere. Do I have to add it to the build.gradle or something?

Add the library resource path to your project's build.gradle file:

sourceSets {
    main {
        res.srcDirs = ['src/main/res','(library-res-path)']
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM