[mono-android] JNI Help Please

Jonathan Pryor jonp at xamarin.com
Mon Jan 16 20:39:53 UTC 2012


On Jan 16, 2012, at 3:16 PM, digitalml wrote:
> This fails on the JNIEnv.CallVoidMethod() call.  Is there a way to see what the error actually is?

An exception is thrown. Exception.ToString() will also print out the Java-side message and stack trace. Throw the code within a try/catch(Exception) block and print out the exception.

> Maybe it's from the java side?  Maybe my methodId is wrong

JNIEnv.GetMethodID() should throw if the method id is wrong; as a sanity check, ensure that the method isn't IntPtr.Zero.

Thanks,
 - Jon



More information about the Monodroid mailing list