[mono-android] monodroid-samples/ApiDemo exception at start-up

Len Charest len at shingl.com
Tue Mar 15 15:39:34 EDT 2011


I'm trying to run the ApiDemo sample app (found at
https://github.com/mono/monodroid-samples) in an emulator. The app crashes
at start-up with the following error:

E/mono    ( 1591): Unhandled Exception: System.TypeInitializationException:
An exception was thrown by the type initializer for Android.Util.Log --->
System.NullReferenceException: Object reference not set to an instance of an
object
E/mono    ( 1591):   at Android.Runtime.JNIEnv.FindClass (System.String
classname) [0x00000] in <filename unknown>:0
E/mono    ( 1591):   at Android.Util.Log..cctor () [0x00000] in <filename
unknown>:0
E/mono    ( 1591):   --- End of inner exception stack trace ---

The static constructor for the Log class calls JNIEnv.FindClass(
"android/util/Log"), which then fails.

I'm building in VS 2010 in Release config, and running a version 2.2
emulator. I've tried all 3 flavors of linking to no avail. Other samples
from the monodroid-samples collection build and run without issue.

Any ideas on what's going wrong and/or how to fix it?

Thanks,
Len
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/mailman/private/monodroid/attachments/20110315/e2f7bf8b/attachment.html 


More information about the Monodroid mailing list