System.Diagnostics.Debugger.Mono_UnhandledException_internal ()

KarenCateKarenCate USMember ✭✭
edited May 2013 in Xamarin.Android

So there I was happily coding away, when all of a sudden, I start getting this error (see thread title). I set a breakpoint on the first line of my OnCreate() functions (in both the application.cs and the main launcher .cs), it crashes before reaching either one.

Now, nothing works. I have cleaned and rebuilt a dozen times. Shut everything down, rebooted, cleaned and rebuilt. Switched Xamarin channels to reload the software. Switched to a different emulator. Created new solution and project files. Still fails.

I copied the project and started pruning. I have it down to virtually nothing, and still I get this error.

I apologize for the following walls of text.

Call Stack window:

System.Diagnostics.Debugger.Mono_UnhandledException_internal () in
System.Diagnostics.Debugger.Mono_UnhandledException (ex=) in
object.743757c1-19a3-4cdf-b26d-73590885b6ec (Parameters=) in
Java.Interop.TypeManager.CreateInstance (Parameters=) in /Users/builder/data/lanes/monodroid-mlion-master/f6831347/source/monodroid/src/Mono.Android/src/Java.Interop/TypeManager.cs:237
Java.Lang.Object.GetObject (Parameters=) in /Users/builder/data/lanes/monodroid-mlion-master/f6831347/source/monodroid/src/Mono.Android/src/Java.Lang/Object.cs:227
Java.Lang.Object._GetObject<Android.App.Application> (Parameters=) in /Users/builder/data/lanes/monodroid-mlion-master/f6831347/source/monodroid/src/Mono.Android/src/Java.Lang/Object.cs:207
Java.Lang.Object.GetObject<Android.App.Application> (Parameters=) in /Users/builder/data/lanes/monodroid-mlion-master/f6831347/source/monodroid/src/Mono.Android/src/Java.Lang/Object.cs:199
Android.App.Application.n_OnCreate (Parameters=) in /Users/builder/data/lanes/monodroid-mlion-master/f6831347/source/monodroid/src/Mono.Android/platforms/android-10/src/generated/Android.App.Application.cs:85
object.743757c1-19a3-4cdf-b26d-73590885b6ec (Parameters=) in

Last few lines of the Android Log:

05-22 02:28:44.750 D/AndroidRuntime( 4624): >>>>>> AndroidRuntime START <<<<<<
05-22 02:28:44.750 D/AndroidRuntime( 4624): CheckJNI is ON
05-22 02:28:45.549 D/AndroidRuntime( 4624): Calling main entry
05-22 02:28:45.579 I/ActivityManager( 83): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=SampleError.SampleError/plants.CollectionsActivity} from pid 4624
05-22 02:28:45.579 W/WindowManager( 83): Failure taking screenshot for (240x394) to layer 21010
05-22 02:28:45.619 I/WindowManager( 83): createSurface Window{41a74d68 Starting SampleError.SampleError paused=false}: DRAW NOW PENDING
05-22 02:28:45.649 D/AndroidRuntime( 4624): Shutting down VM
05-22 02:28:45.680 D/dalvikvm( 4634): Not late-enabling CheckJNI (already on)
05-22 02:28:45.680 I/AndroidRuntime( 4624): NOTE: attach of thread 'Binder Thread #3' failed
05-22 02:28:45.719 I/ActivityManager( 83): Start proc SampleError.SampleError for activity SampleError.SampleError/plants.CollectionsActivity: pid=4634 uid=10044 gids={3003}
05-22 02:28:45.719 D/dalvikvm( 4624): GC_CONCURRENT freed 98K, 77% free 477K/2048K, paused 1ms+1ms
05-22 02:28:45.959 I/dalvikvm( 4634): Turning on JNI app bug workarounds for target SDK version 10...
05-22 02:28:46.099 W/NetworkManagementSocketTagger( 83): setKernelCountSet(10044, 1) failed with errno -2
05-22 02:28:46.369 V/PhoneStatusBar( 137): setLightsOn(true)
05-22 02:28:46.669 I/ActivityThread( 4634): Pub SampleError.SampleError.mono.MonoRuntimeProvider.mono_init: mono.MonoRuntimeProvider
05-22 02:28:46.809 D/dalvikvm( 4634): Trying to load lib /data/data/SampleError.SampleError/lib/ 0x4175a5b8
05-22 02:28:46.809 D/dalvikvm( 4634): Added shared lib /data/data/SampleError.SampleError/lib/ 0x4175a5b8
05-22 02:28:47.119 W/MonoDroid-Debugger( 4634): Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=,server=y,embedding=1
05-22 02:28:47.589 W/MonoDroid-Debugger( 4634): Accepted stdout connection: 41
05-22 02:28:48.859 W/monodroid-gc( 4634): GREF GC Threshold: 1800
05-22 02:28:55.632 W/ActivityManager( 83): Launch timeout has expired, giving up wake lock!
05-22 02:28:56.130 W/ActivityManager( 83): Activity idle timeout for ActivityRecord{41a204c8 SampleError.SampleError/plants.CollectionsActivity}
05-22 02:30:08.500 D/dalvikvm( 4634): threadid=12: thread exiting, not yet detached (count=0)
05-22 02:30:08.590 I/ActivityManager( 83): Process SampleError.SampleError (pid 4634) has died.
05-22 02:30:08.590 W/ActivityManager( 83): Force removing ActivityRecord{41a204c8 SampleError.SampleError/plants.CollectionsActivity}: app died, no saved state
05-22 02:30:08.600 I/WindowManager( 83): createSurface Window{41937200 paused=false}: DRAW NOW PENDING
05-22 02:30:08.600 W/NetworkManagementSocketTagger( 83): setKernelCountSet(10044, 0) failed with errno -2
05-22 02:30:09.040 W/InputManagerService( 83): Window already focused, ignoring focus gain of: [email protected]


I have attached a copy of my pruned down project. The whole thing.

In the course of composing this email, I downloaded Tasky and compiled that. It, of course, runs just fine. I tweaked a few things to make my project configuration match it, but still no change.

If you have any hints for me, I would greatly appreciate it.


  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

    Builds and works fine for me - have you tried re-installing the Android SDK's themselves?

  • KarenCateKarenCate USMember ✭✭
    edited May 2013

    I didn't have time to reinstall everything, so I switched to another computer that I hadn't used for development for a while. I was a little too hopeful and tried building and running my full project first, and now the 2nd system reproduces the problem nicely. And I will not be able to reload anything until next week when I get back to decent internet service.

    Even if I reload everything and that little test project works, I suspect that my full project will re-corrupt the install and I'm still dead in the water.

    Thank you for verifying that it's my installation and not in a "clean" copy of the environment! I'll set myself up for efficient reloads of the development tools then back things out until I find the bit that's corrupting things. Thanks!

  • KarenCateKarenCate USMember ✭✭

    Ok, I've had some progress here. I've discovered if I click the "Wipe User Data" checkbox when I bring up the emulator, "valid" apps will now run after I run my broken one. That's handy for debugging. The sample I uploaded now works just fine under these conditions.

    I was subclassing the Application object. There wasn't much in that class, so I moved what I needed to my activity and removed it. My app now runs.

    I have no idea what I did in my application object that started corrupting the emulator. It really just hosted some common data. I've spent way too much time trying to debug this, so I'm going to pretend it didn't happen and move on with my life :)

    Thank you folks for your help!

  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

    Great that you manage to solve this!

    It's pretty easy to corrupt the emulator actually. Once in a while you will want to clean that thing out.

Sign In or Register to comment.