Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Has any body faced with inner class duplication issue during .aar binding?

I am trying to port Authorize.Net android library to Xamarin.Android
I follow all instructions regarding to .aar library binding flow, but the result is:
/../AuthorizeNET_AcceptSDK_Binding/obj/Debug/generated/src/Net.Authorize.Acceptsdk.Parser.JSONConstants.cs(25,25): Error CS0102: The type Net.Authorize.Acceptsdk.Parser.JSONConstants' already contains a definition forResultCode' (CS0102) (AuthorizeNET_AcceptSDK_Binding)

Generated C# file section looks:

`// Metadata.xml XPath class reference: path="/api/package[@name='net.authorize.acceptsdk.parser']/class[@name='JSONConstants']"
    [global::Android.Runtime.Register ("net/authorize/acceptsdk/parser/JSONConstants", DoNotGenerateAcw=true)]
    public sealed partial class JSONConstants : global::Java.Lang.Object {

            // Lots of code............

        [Register ("net/authorize/acceptsdk/parser/JSONConstants$ResultCode", DoNotGenerateAcw=true)]
        public abstract class ResultCode : Java.Lang.Object {

                internal ResultCode ()
                {
                }

                // Metadata.xml XPath field reference:  path="/api/package[@name='net.authorize.acceptsdk.parser']/interface[@name='JSONConstants.ResultCode']/field[@name='ERROR']"
                [Register ("ERROR")]
                public const string Error = (string) "Error";

                // Metadata.xml XPath field reference: path="/api/package[@name='net.authorize.acceptsdk.parser']/interface[@name='JSONConstants.ResultCode']/field[@name='OK']"
                [Register ("OK")]
                public const string Ok = (string) "Ok";
            }

            [Register ("net/authorize/acceptsdk/parser/JSONConstants$ResultCode", DoNotGenerateAcw=true)] //** HERE is the problem**
            [global::System.Obsolete ("Use the 'ResultCode' type. This type will be removed in a future release.")]
            public abstract class ResultCodeConsts : ResultCode {

                private ResultCodeConsts ()
                {
                }
            }
        // Lots of code............
    }`

As we can see:

Register ("net/authorize/acceptsdk/parser/JSONConstants$ResultCode", DoNotGenerateAcw=true)]
generated twice, instead of
[Register ("net/authorize/acceptsdk/parser/JSONConstants$ResultCodeConsts", DoNotGenerateAcw=true)]

I have tried to exclude the ResultCodeConsts class by using the next metadata attributes:

`<remove-node path="/api/package[@name='net.authorize.acceptsdk.parser']/class[@name='JSONConstants.ResultCodeConsts']" />`

and

`<remove-node path="/api/package[@name='net.authorize.acceptsdk.parser']/class[@name='JSONConstants$ResultCodeConsts']" />`

as well, but no success

What I did wrong?

Answers

Sign In or Register to comment.