Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Binding Library Error: How to make a method return an array of IDictionary ?

$
0
0

I am getting an error when I import a .aar file to integrate with a machine service.

My question is as per the title.

This the code I am trying to get:

[Register ("getSlots", "()[Ljava/util/HashMap;", "")]
        public unsafe global::System.Collections.Generic.IDictionary <string, byte[]> [] GetSlots ()
        {
            const string __id = "getSlots.()[Ljava/util/HashMap;";
            try {
                var __rm = _members.InstanceMethods.InvokeNonvirtualObjectMethod (__id, this, null);
                return (global::System.Collections.Generic.IDictionary<string, byte[]>[]) JNIEnv.GetArray (__rm.Handle, JniHandleOwnership.TransferLocalRef, typeof (global::System.Collections.Generic.IDictionary<string, byte[]>));
            } finally {
            }
        }

This is the code I am getting:

[Register ("getSlots", "()[Ljava/util/HashMap;", "")]
        public unsafe global::System.Collections.Generic.IDictionary <string, byte[]>GetSlots ()
        {
            const string __id = "getSlots.()[Ljava/util/HashMap;";
            try {
                var __rm = _members.InstanceMethods.InvokeNonvirtualObjectMethod (__id, this, null);
                return (global::System.Collections.Generic.IDictionary<string, byte[]>[]) JNIEnv.GetArray (__rm.Handle, JniHandleOwnership.TransferLocalRef, typeof (global::System.Collections.Generic.IDictionary<string, byte[]>));
            } finally {
            }
        }

I need a method that returns an array IDictionary <string, byte[]>[], but I am getting IDictionary <string, byte[]>

This is the code that is in metadata.xml

<attr path="/api/package[@name='br.com.uol.pagseguro.plugpagservice.wrapper']/class[@name='PlugPagNFCResult']/method[@name='getSlots' and count(parameter)=0]" name="managedReturn">System.Collections.Generic.IDictionary &lt;string, byte[]&gt;</attr>

But every time I write "[]", after ">", it doesn't appear to form an array!

Could you help me with this?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>