Hi,
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");
I know my class is ok and in the project because it builds and runs fine on
the Windows machine using Visual Studio. I have checked the MonoDevelop
settings and they appear to be fine, even made sure the BuildAction of my
.java file was set to AndroidJavaSource.
So, is there anything I need to do differently on the Mac OSX and
MonoDevelop platform compared with Windows7 and Visual Studio?
I installed everything today so I have the latest everything. 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
at QuickPlan.Source.Main.InitUI () [0x0013c] in
/Users/john/Projects/quickplan-android/QuickPlan/QuickPlan/Source/Main.cs:189
at QuickPlan.Source.Main.OnCreate (Android.OS.Bundle) [0x0001a] in
/Users/john/Projects/quickplan-android/QuickPlan/QuickPlan/Source/Main.cs:108
at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_
(intptr,intptr,intptr) [0x00010] in
/Users/builder/data/lanes/monodroid-mac-monodroid-4.2.3-branch/410a5aba/source/monodroid/src/Mono.Android/platforms/android-7/src/generated/Android.App.Activity.cs:1490
at (wrapper dynamic-method) object.150e044d-faf4-481a-a166-31360af72c59
(intptr,intptr,intptr) <IL 0x00012, 0x00033>
Would be eternally grateful if some kind soul has any thoughts...
thank you
John
--
View this message in context:
http://mono-for-android.1047100.n5.nabble.com/JNIEnv-FindClass-works-in-Visual-Studio-Null-Object-Exception-in-MonoDevelop-tp5710685.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid