[mono-android] Java.Lang.NoClassDefFoundError: java.lang.ICharSequence
Jonathan Pryor
jonp at xamarin.com
Tue Dec 6 12:13:53 EST 2011
On Dec 6, 2011, at 11:53 AM, Andrew Sinclair wrote:
> Is there a way of checking for existing registrations?
Unfortunately not at this time. Sorry.
What I would suggest doing is subclassing Android.App.Application, using the [Application] custom attribute, overriding Application.OnCreate(), and doing the registration there:
[Application]
class MyApp : Application {
public override void OnCreate ()
{
Android.Runtime.TypeManager.RegisterType ("java/langCharSequence", typeof (Java.Lang.ICharSequence));
}
}
This will ensure it gets executed at startup, and you won't need to worry about duplicative work. Unfortunately, it'll also slow down app startup, but it's likely the best we can do until the next release.
Thanks,
- Jon
More information about the Monodroid
mailing list