gpt4 book ai didi

Android-Studio:Gradle 找不到 HoloEverywhere

转载 作者:行者123 更新时间:2023-11-29 01:53:29 27 4
gpt4 key购买 nike

经过数小时与 android-studio 和 HoloEverywhere+ActionBarSherlock 的斗争,我终于成功地设置了一切; holoeverywhere 类可以在 android-studio 中找到。但是,在“制作”或“编译”我的项目时,出现以下错误:

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'.

现在,在我的 themes.xml 文件中,我创建了一些继承自 Holo.ThemeHolo.Theme.Light 的样式。它确实在 Eclipse 中工作,并且由于似乎找到了 HoloEverywhere 并将其添加为我的项目的依赖项,为什么 gradle 找不到这些定义?

代码和往常一样:

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

感谢您的帮助!


顺便说一下,样式是由 android-studio 找到的,因为它不会在编辑器中提示。只有当我制作或编译时,才会出现这些错误。


另一件事,可能有帮助:我尝试从 xml 中删除 HoloEverywhere Stuff,然后编译,gradle 也提示 Java 类。因此,gradle 似乎没有找到 HoloEverywhere 的任何内容。我是否必须将它添加到 build.gradle 或其他什么?

最佳答案

将库资源路径添加到项目的build.gradle文件中:

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

关于Android-Studio:Gradle 找不到 HoloEverywhere,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16639534/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com