Hi,

I'm having a problem with subclassing AsyncTask<>. I think this may be
related to a known Mono for Android bug.

I have a class that subclasses AsyncTask<> and implements
RunInBackground() and OnPostExecute(). This
compiles and deploys, but a release build fails at run time (on
emulator or real device). Logcat gives me the
following:

E/mono    ( 1446): Unhandled Exception: System.ArgumentException:
Couldn't bind to method
'GetDoInBackground_arrayLjava_lang_Object_Handler'.
E/mono    ( 1446):   at System.Delegate.GetCandidateMethod
(System.Type type, System.Type target, System.String method,
BindingFlags bflags, Boolean ignoreCase,
 Boolean throwOnBindFailure) [0x00000] in <filename unknown>:0
E/mono    ( 1446):   at System.Delegate.CreateDelegate (System.Type
type, System.Type target, System.String method, Boolean ignoreCase,
Boolean throwOnBindFailu
re) [0x00000] in <filename unknown>:0
E/mono    ( 1446):   at System.Delegate.CreateDelegate (System.Type
type, System.Type target, System.String method) [0x00000] in <filename
unknown>:0
E/mono    ( 1446):   at Android.Runtime.JNIEnv.RegisterJniNatives
(IntPtr typeName_ptr, Int32 typeName_len, IntPtr jniClass, IntPtr
methods_ptr, Int32 methods_l
en) [0x00000] in <filename unknown>:0
E/mono    ( 1446):   at (wrapper delegate-invoke)
<Module>:invoke_intptr__this___intptr_intptr_string_string
(intptr,intptr,string,string)
E/mono    ( 1446):   at Android.Runtime.JNIEnv.GetMethodID (IntPtr
kls, System.String name, System.St
D/Zygote  (   33): Process 1446 exited cleanly (1)

This looks like a known bug filed at
https://bugzilla.novell.com/show_bug.cgi?id=690048 and also (later?)
at https://bugzilla.xamarin.com/show_bug.cgi?id=1945. This seems to
have come out of discussion at
http://mono-for-android.1047100.n5.nabble.com/another-Java-versus-C-how-to-td4332736.html
involving
Jonathan Pryor.

I'm confused because the bug on the xamarin bugzilla is marked as
RESOLVED FIXED, but I'm seeing
it in monodroid 4.0.4 (win7/vs2010), which seems to be the latest version.

Is this fixed, or am I seeing a regression or just doing something
wrong? Any workaround?

Thanks,

Andy Johnson
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to