[android-developers] Re: Android Library Project

2010-07-09 Thread Vladimir Lebedev-Schmidthof
Hello Mark,

I faced the same problem with attrs.xml in Library Project. Have you
finally found the solution?


On 23 май, 23:22, Mark Carter mjc1...@googlemail.com wrote:
 I'm sure that thelibrary.apk file error was because I had added 
 thelibraryprojectto my appprojectbuild path.

 The other problem, where appprojectclasses could not seelibraryprojectclasses 
 was due to something else.

 For some strange reason, even when the androidlibrarycompiles by
 itself (I mean, does not show any errors in eclipse), it can give
 compiler errors when used as alibraryin anotherproject. In that
 situation, it does not show up like LibProject in your png file.

 In my situation, this was caused by a problem with a custom widgets I
 had defined in mylibrary. The attrs.xml file was being ignored for
 some reason. Everything worked fine (i.e. the LibProject showed up as
 in your png file) when I removed those custom widget (I'm not talking
 about homescreen widgets)attributesfrom the relevant layout xml in
 thelibraryproject.

 Sorry all this is a bit vague. I'll try and come up with a clearer
 scenario but I'm right in the middle of something now.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group 
 athttp://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] custom attributes in library projects

2010-07-09 Thread Vladimir Lebedev-Schmidthof
Hello,

Having custom attribute (in attrs.xml) in library project leads to
compilation fail of the project dependent of that library.

I.e.:
MyLib project (library)

AndroidManifest.xml:
manifest xmlns:android=http://schemas.android.com/apk/res/android;
  package=com.mycompany.test.lib
  android:versionCode=1
  android:versionName=1.0
...
/manifest

res/layout/main.xml:
?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
xmlns:my=http://schemas.android.com/apk/res/
com.mycompany.test.lib
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent

com.mycompany.test.lib.MyWidget
android:id=@+id/my_widget
android:layout_width=fill_parent
android:layout_height=fill_parent
my:customValue=324/
/LinearLayout

res/values/attrs.xml:
resources
declare-styleable name=MyWidget
attr name=customValue format=integer/
/declare-styleable
/resources

And there are nothing in TestApp except AndroidManifest.xml:
manifest xmlns:android=http://schemas.android.com/apk/res/android;
  package=com.mycompany.test.app
  android:versionCode=1
  android:versionName=1.0
...
/manifest

And aapt says that
res/layout/main.xml:13: error: No resource identifier found for
attribute 'customValue' in package 'com.mycompany.test.lib'

How to avoid this except for no having custom attributes in library?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en