Received: by 10.100.126.17 with SMTP id y17mr768860anc.33.1282305891229; Fri, 20 Aug 2010 05:04:51 -0700 (PDT) X-BeenThere: android-developers@googlegroups.com Received: by 10.101.146.2 with SMTP id y2ls1258325ann.6.p; Fri, 20 Aug 2010 05:04:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.97.13 with SMTP id z13mr174387anl.11.1282305855019; Fri, 20 Aug 2010 05:04:15 -0700 (PDT) Received: by j8g2000yqd.googlegroups.com with HTTP; Fri, 20 Aug 2010 05:04:14 -0700 (PDT) Date: Fri, 20 Aug 2010 05:04:14 -0700 (PDT) In-Reply-To: X-IP: 195.115.183.13 References: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 ( .NET CLR 3.5.30729),gzip(gfe) Message-ID: Subject: Re: custom attributes in library projects From: =?ISO-8859-1?Q?Cl=E9ment_Plantier?= To: Android Developers Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Any update about this problem? On Jul 9, 8:18=A0pm, Xavier Ducrohet wrote: > Ah, there's a problem with the namespace. > > From aapt's point of view all the resources are compiled for the > package name of the application (com.mycompany.test.app in your case), > so your "customValue" attribute is defined in that namespace, and not > in the namespace of thelibrary. > > At this time, the only solution is to remove the layout from thelibraryan= d move it into the apps and edit the namespace to match the > application package. > > We'll look at fixing this. > xav > > On Thu, Jul 8, 2010 at 3:27 AM, Vladimir Lebedev-Schmidthof > > > > wrote: > > Hello, > > > Having custom attribute (in attrs.xml) inlibraryproject leads to > > compilation fail of the project dependent of thatlibrary. > > > I.e.: > > MyLib project (library) > > > AndroidManifest.xml: > > > =A0 =A0 =A0package=3D"com.mycompany.test.lib" > > =A0 =A0 =A0android:versionCode=3D"1" > > =A0 =A0 =A0android:versionName=3D"1.0"> > > ... > > > > > res/layout/main.xml: > > > > > android" > > =A0 =A0 =A0 =A0xmlns:my=3D"http://schemas.android.com/apk/res/ > > com.mycompany.test.lib" > > =A0 =A0android:orientation=3D"vertical" > > =A0 =A0android:layout_width=3D"fill_parent" > > =A0 =A0android:layout_height=3D"fill_parent" > > =A0 =A0> > > > =A0 =A0android:id=3D"@+id/my_widget" > > =A0 =A0android:layout_width=3D"fill_parent" > > =A0 =A0android:layout_height=3D"fill_parent" > > =A0 =A0my:customValue=3D"324"/> > > > > > res/values/attrs.xml: > > > > =A0 =A0 =A0 =A0 > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > > =A0 =A0 =A0 =A0 > > > > > And there are nothing in TestApp except AndroidManifest.xml: > > > =A0 =A0 =A0package=3D"com.mycompany.test.app" > > =A0 =A0 =A0android:versionCode=3D"1" > > =A0 =A0 =A0android:versionName=3D"1.0"> > > ... > > > > > And aapt says that > > res/layout/main.xml:13: error:No resource identifier found for> attribu= te'customValue' in package 'com.mycompany.test.lib' > > > How to avoid this except for no having custom attributes inlibrary? > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to android-develop...@googlegroups.co= m > > To unsubscribe from this group, send email to > > android-developers+unsubscribe@googlegroups.com > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=3Den > > -- > Xavier Ducrohet > Android SDK Tech Lead > Google Inc. >