使用 Ant 构建一个项目,其中包含 ActionbarSherlock 作为库项目
我在使用 Apache 的 Ant 构建项目时遇到问题,其中包含 ActionbarSherlock 作为项目库。我已经使用“android update lib-project --path . --target android-13”成功地将库包含在actionbarsherlock库文件夹中,并在我的项目中使用了“android update project --path . --target android-13 --library” path/to/actionbarsherlock/library"
使用 ant debug 正确构建库,但是当转到我的项目文件夹并尝试构建项目时,我收到以下错误:
[aapt] /var/www/vhosts/nicom/httpdocs/cl_app/res/values/style.xml:40:错误:检索项目的父级时出错:找不到与给定名称“Theme.Sherlock.Light”匹配的资源。 [aapt] /var/www/vhosts/nicom/httpdocs/cl_app/res/values/style.xml:41:错误:错误:找不到与给定名称匹配的资源:attr 'abBackground'。 [aapt] /var/www/vhosts/nicom/httpdocs/cl_app/res/values/style.xml:42:错误:错误:找不到与给定名称匹配的资源:attr 'abLogo'。 [aapt] /var/www/vhosts/nicom/httpdocs/cl_app/res/values/style.xml:43:错误:错误:找不到与给定名称匹配的资源:attr 'actionBarSize'。
有人用这个库成功构建了一个项目吗?我猜这是一个库特定的错误,一般与我的项目无关,但如果我错了,请有人纠正我。
I'm having an issue building my project with Apache's Ant which includes ActionbarSherlock as a project library. I have successfully included the library using "android update lib-project --path . --target android-13" in actionbarsherlock library folder and in my project used "android update project --path . --target android-13 --library path/to/actionbarsherlock/library"
Using ant debug builds the library correctly but when going to my project folder and trying to build the project i get the following errors:
[aapt] /var/www/vhosts/nicom/httpdocs/cl_app/res/values/style.xml:40: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.Light'.
[aapt] /var/www/vhosts/nicom/httpdocs/cl_app/res/values/style.xml:41: error: Error: No resource found that matches the given name: attr 'abBackground'.
[aapt] /var/www/vhosts/nicom/httpdocs/cl_app/res/values/style.xml:42: error: Error: No resource found that matches the given name: attr 'abLogo'.
[aapt] /var/www/vhosts/nicom/httpdocs/cl_app/res/values/style.xml:43: error: Error: No resource found that matches the given name: attr 'actionBarSize'.
Has anyone successfully built a project with this library? I'm guessing this is a library specific error and has nothing to do with my project in general but some one please correct me if I'm wrong.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实上,我也遇到了同样的问题,这非常令人沮丧,因为我不知道我做错了什么。但事实证明 android-sdk 存在一些问题,不允许在库项目中定义自定义属性。
Google 问题页面显示该问题已开放很长时间!
因此,现在,如果您确实需要使用该库,则需要复制该库中存在的所有布局文件。 (我知道,这很糟糕!)
Actually, I had this same problem and it was very frustrating because I didn't know what it is that I was doing wrong. But it turns out that there is some issue with the android-sdk that doesn't allow custom attributes to be defined in a library project.
Google Issue page shows that this has been open for a long time!
So for now, if you really need to use the library, you need to copy all the layout files that are present there in the library. (I know, it sucks!)