I just ran into a weird problem. I have a Xamarin Android app, which I just reorganized slightly: I added a Portable Class Library to the solution, and I moved the business classes into that new library. After launching, though, the app now crashes at startup, and the output reports a stack overflow because the OnCreate
method of MyApplication
calls a native n_onCreate
method, which in turns calls MyApplication.OnCreate
.
I'm sincerely puzzled. I made no changes to the OnCreate
method, nor to any part of the MyApplication
class, and I have no idea where this infinite call loop could come from. Any hint is greatly appreciated.
EDIT
MyApplication
inherits from Application
, overrides OnCreate
and the OnCreate
method calls base.OnCreate
. Here it is:
public override void OnCreate()
{
base.OnCreate();
MobileBarcodeScanner.Initialize(this);
}
I also tried to decorate the method with
[Android.Runtime.Register("onCreate", "()V", "GetOnCreateHandler")]
to no avail.