On Jul 1, 2012, at 5:26 AM, jh092 wrote:
> I have an existing Mono Android project in Visual Studio that works fine. I
> have now tried to rebuild and run the exact same code on my iMac using
> MonoDevelop. It builds, runs and then throws an exception with this line:
>
> IntPtr JSInterface_Class =
> JNIEnv.FindClass("com.fswidgets.jsinterface.JSInterface");
Sounds like a bug; afaik there shouldn't be any difference between Windows and
OS X here. :-/
Aside: JNIEnv.FindClass() takes a JNI type signature, not a Java one, so this
should instead be:
IntPtr JSInterface_Class =
JNIEnv.FindClass("com/fswidgets/jsinterface/JSInterface");
i.e. regex s#\.#/#g.
> This is the exception (which does not happen on Visual Studio):
>
> System.NullReferenceException: Object reference not set to an instance of an
> object
> at Android.Runtime.JNIEnv.FindClass (string) [0x00000] in
> /Users/builder/data/lanes/monodroid-mac-monodroid-4.2.3-branch/410a5aba/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:256
That doesn't make any sense at all. :-/
I would love to have a bug report with this code attached so I can investigate.
Thanks,
- Jon
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid