我将一个项目转换为库项目并将其链接到另一个项目,但我收到这些错误(SearchFacebook 是库项目):
[2012-11-02 16:29:10 - FacebookFollower] G:\AndroidProjects\FacebookUpdaterFollower\SearchFacebook\res\layout\test_results_auto_complete.xml:2: error: No resource identifier found for attribute 'categories' in package 'shira.android.facebook.updaterfollower.search'
[2012-11-02 16:29:10 - FacebookFollower] G:\AndroidProjects\FacebookUpdaterFollower\SearchFacebook\res\layout\test_results_auto_complete.xml:2: error: No resource identifier found for attribute 'max_results' in package 'shira.android.facebook.updaterfollower.search'
我检查了 R 文件和资源标识符,当链接的项目编译为独立项目(而不是库)时,我没有收到这些错误。
顺便问一下,我可以链接 Android 项目而不将其转换为库吗?
更新:按照建议,我更改了使用自定义属性的命名空间。我在使用该库的项目中的布局文件现在看起来像这样(相关部分):
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent" android:padding="5dp"
xmlns:search="http://schemas.android.com/apk/res-auto">
<shira.android.facebook.updaterfollower.search.FacebookResultsAutoComplete
android:id="@+id/followed_type_auto_complete" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" android:hint="@string/followed_type"
search:max_results="15"/>
但是,我仍然遇到与以前相同的错误,并且我已将 Android Tools 更新到最新版本,那么会出现什么问题呢?
最佳答案
您可能遇到了由库项目中的自定义属性引起的已知错误。
http://code.google.com/p/android/issues/detail?id=9656
幸运的是,r17 android 工具引入了修复程序。 Comment 71这个问题应该为您指明一个可行的解决方案。
关于android - 将 Android 项目链接到另一个项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13197570/