Android Binding Library Error: How to make a method return an array of Idictionary <Tkey, Tvalue>?

Asked

Viewed 56 times

0

Hi guys, I would really like someone to help me with this error I’m getting when I import a.Aar file, in an Android Binding Library project, to realize an integration with the service of a little machine.

Good basically the error if summary in the title above

That’s the code I wish to get

        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 {
            }
        }

That’s the code I’m getting

        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 {
            }
        }

As you can see, I need a method that returns an array IDictionary<string, byte[]> [] and I’m getting a 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 put the [], after the >, it does not appear to form an array! *

  • Could you help me with that?*

  • Are you sure this API is trying to return multiple array dictionaries, rather than a single multi-line dictionary?

  • Yes this is the return of the method that is generated when I build the project return (global::System.Collections.Generic.IDictionary<string, byte[]>[]) JNIEnv.GetArray (__rm.Handle, JniHandleOwnership.TransferLocalRef, typeof (global::System.Collections.Generic.IDictionary<string, byte[]>));

  • I took a look at the API documentation and it really is an array of dictionaries. Try editing the Metadata.xml and putting a [] after the &gt;

  • Every time I put the [], after the >, the sign [] does not trim the generated code. It is as if it does not accept any more characters after the >. This is the code I put in the media.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>

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.