[Monodroid] New build error, unable to build

Jonathan Pryor jpryor at novell.com
Wed Mar 2 19:21:09 EST 2011


On Mar 2, 2011, at 4:41 PM, Chris Erickson wrote:
> I'm unable to build again, with an unhelpful error.  Can anybody add any insight?

What, the following isn't clear enough: ;-)

> /Users/chriserickson/Projects/MultiTargetSampleIOS/MultiTargetSampleMonoDroid/obj/Debug/res/layout/main.axml:9: error: No resource identifier found for attribute 'text' in package 'com.cartopac.android.binding'

As per your later email, you have:

	<LinearLayout ...
			xmlns:binding="http://schemas.android.com/apk/res/com.cartopac.android.binding"
			>
		<TextView ... 
				binding:text="TextDisplayBinding"
				...

The problem is that `aapt` doesn't like this. At all.

Doing the same thing (custom xmlns declaration + binding:text attribute) within Eclipse results in the same error.

However, one thing that stood out to me was:

	xmlns:binding="http://schemas.android.com/apk/res/com.cartopac.android.binding"

This didn't strike me as being "kosher," as you're sticking your own custom string after someone elses TLD. Don't do that.

In fact:

	http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=tools/aapt/XMLNode.cpp;h=c0d74275a8a6a6883fedeed008ab6e993e4658cc;hb=HEAD#l49

If an XML namespace starts with RESOURCES_PREFIX, aka RESOURCES_ROOT_NAMESPACE, aka "http://schemas.android.com/apk/res/", then `aapt` considers the namespace to be "public" and treats it specially, which is your actual problem.

Consequently, if I change the above xml namespace declaration to:

	xmlns:binding="http://com.cartopac.android.binding"

then `aapt` builds the Eclipse project fine, so I believe the actual problem is that you chose a terrible xml namespace ID.

 - Jon



More information about the Monodroid mailing list