Archived

This forum has been archived. Please start a new discussion on GitHub.

Ice on Mono on Android

Hello,

there is my problem :

We have developped an application using Mono. The desktop version works perfectly well. However, when we ported it on Android, we had some problems.

Most of the application and Ice functionnalities are working. But whenever we try to send 'float' or 'double' using Ice, it fails. There is the error message at runtime :
NullReferenceException: Object reference not set to an instance of an object
  at IceInternal.ByteBuffer.putFloat (Single val) [0x00000] in <filename unknown>:0 
   at IceInternal.BasicStream.writeFloat (Single v) [0x00000] in <filename unknown>:0 
   at Module.ItfEventsPrxHelper.begin_sendfunction (Single f, System.Collections.Generic.Dictionary`2 ctx__, Boolean explicitContext__, Ice.AsyncCallback cb__, System.Object cookie__) [0x00000] in <filename unknown>:0 
   at Module.ItfEventsPrxHelper.begin_sendfunction (Single f) [0x00000] in <filename unknown>:0 
   at MyClass.MyFunction(float f) [0x00000] in <filename unknown>:0

This very same function works perfectly well on desktop platforms.

Also, we're still using Ice 3.4.1. Could it be related?

Comments

  • mes
    mes California
    Hi Alan,

    Welcome to the forum.

    Did you compile the Ice assembly with MANAGED=yes?

    Regards,
    Mark
  • bernard
    bernard Jupiter, FL
    Hello Alan,

    Looking at the code for IceInternal.ByteBuffer.putFloat, it's most likely a managed vs unmanaged code issue.

    The Ice DLL included in our binary distribution incorporates some unmanaged code, and it looks like it does not work with Mono for Android. You should build your own managed Ice DLL, as described in the INSTALL.MONO included in the Ice source distribution.

    Best regards,
    Bernard
  • Hello,

    You were right. After we built our own Ice DLL, with the option MANAGED = yes, our Android application started working.

    Thanks a lot,
    Alan