login about faq

The Chilkat Xamarin component for iOS and Android C# applications is ready for testing:


asked Feb 25 '14 at 21:08

chilkat's gravatar image

chilkat ♦♦

Congrats on the Xamarin test release. I have been waiting for this one! Thanks for your hard work. :-)

(Mar 07 '14 at 15:42) fraXis

I'm getting this exception when trying to set ProgressInfo callback object.


Unexpected exception, System.ExecutionEngineException:
``Attempting to JIT compile method '(wrapper native-to-managed) ImapClient:ProgressInfoHandler (intptr,intptr)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.

  at (wrapper managed-to-native) object:__icall_wrapper_mono_delegate_to_ftnptr (object)
  at (wrapper managed-to-native) Chilkat.Imap:ckSetFnProgressInfo (intptr,Chilkat.Imap/ProgressInfo)
  at Chilkat.Imap.setProgressInfoCb (Chilkat.ProgressInfo callbackObj) [0x00008] in /...../Chilkat/Imap.cs:419

answered Feb 28 '14 at 09:07

glupata's gravatar image


Thanks! I'm investigating...

(Feb 28 '14 at 12:06) chilkat ♦♦

The Chilkat components/libs are implemented internally in C++, and therefore the Mono/Xamarin is composed of the native implementation (static libs for iOS and a shared lib for Android). The C# sources that are included in the download (one per Chilkat class) are the managed classes that call into the native implementation. Therefore, the callbacks are calls originate from within unmanaged code, and call back into your application's managed code.

iOS does not have the capability to deploy shared libs with an application. This is why Chilkat provides the static libs w/ iOS. Xamarin compiles the static libs into an executable, but to do so it must use Mono's Ahead of Time Compiler (AOT). With Xamarin/MonoTouch, this introduces the following requirement for iOS:

Only static functions can be called back from unmanaged code, and they must be decorated with the MonoPInvokeCallbackAttribute attribute. See http://docs.go-mono.com/?link=T%3aMonoTouch.MonoPInvokeCallbackAttribute

Therefore, the solution is to apply these changes to your callback method. For example:

public class MyAppClass
    // ....

[MonoPInvokeCallback (typeof (Chilkat.Imap.ProgressInfo))]
    public static void ProgressInfoHandler(string name, string value)
        // application code goes here.

// ....


answered Mar 01 '14 at 09:14

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Feb 25 '14 at 21:08

Seen: 1,585 times

Last updated: Mar 07 '14 at 15:42

powered by OSQA