Recently, my Xamarin.Android app has started to crash on launch, caused by:
Java.Lang.ClassNotFoundException: mono.android.app.Application
This exception is being thrown more often than not. Usually, a rebuild fixes the issue for a build or two. I tried to combat the issue by making my own application class:
[Application(AllowBackup = true, Debuggable = true, Label = "My Application",
Theme = "@style/AppBaseTheme", Icon = "@drawable/icon", Logo = "@drawable/icon")]
[MetaData("com.google.android.gms.version", Value = "@integer/google_play_services_version"),
MetaData("com.google.android.geo.API_KEY", Value = "[redacted]")]
public class MyApplication: Application {
public MyApplication(IntPtr handle, JniHandleOwnership ownership) : base(handle, ownership) {
}
public override void OnCreate() {
base.OnCreate();
}
}
Unfortunately, the same exception occurs (except that it's upset about not finding my class, instead of Mono's). Various Google searches, Xamarin Forums threads, and StackOverflow questions haven't helped a whole lot (in fact, the ideas to rebuild and make a custom application class came from that). This issue is really annoying and it is making it hard for me to debug my app. Am I doing something wrong? How can I fix this?