使用Ant构建项目并将ActionbarSherlock作为库项目包含进去

10

我正在使用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: 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'。

是否有人成功地使用这个库构建了一个项目?我猜测这是一个特定于库的错误,与我的项目无关,但如果我错了,请有人纠正我。


你有没有在这方面有什么好运? - Jared Kells
1个回答

1

其实,我曾经遇到过同样的问题,非常令人沮丧,因为我不知道自己做错了什么。但事实证明,android-sdk存在一些问题,不允许在库项目中定义自定义属性。

Google Issue page显示这个问题已经存在很长时间了!

所以现在,如果你真的需要使用该库,你需要复制所有存在于库中的布局文件。(我知道,这很糟糕!)


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接