Forum Xamarin.Android

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Error CS0534 "CurrentCity" does not implement the inherited abstract member

blue_riverblue_river Member ✭✭
edited June 2020 in Xamarin.Android

hi,everyone
When building an xamarin binding library project from a Java library, the following error occurs during generation:
Error CS0534 "CurrentCity" does not implement the inherited abstract member "MessageMicro.MergeFrom(CodedInputStreamMicro)"......

Java code:

public abstract class MessageMicro
{
     public abstract MessageMicro mergeFrom(CodedInputStreamMicro paramCodedInputStreamMicro) throws IOException;
     //.......
}


public final class CurrentCity extends MessageMicro
{
    //Implement the parent class member "mergeFrom"
    public CurrentCity mergeFrom(CodedInputStreamMicro paramCodedInputStreamMicro) throws IOException
    {
        while (true) {
            int i = paramCodedInputStreamMicro.readTag();
            switch (i)
            {
                case 0:
                    return this;
                    ..........

            }
        }
    }
}

I opened the ...\obj\Debug\generated\src\xxx.MessageMicro.cs file and found that the generated C# code is:

public abstract global::Com.Google.Protobuf.Micro.MessageMicro MergeFrom (global::Com.Google.Protobuf.Micro.CodedInputStreamMicro p0);

public override unsafe global::Com.Google.Protobuf.Micro.MessageMicro MergeFrom (global::Com.Google.Protobuf.Micro.CodedInputStreamMicro p0)
{
    const string __id = "mergeFrom.(Lcom/google/protobuf/micro/CodedInputStreamMicro;)Lcom/google/protobuf/micro/MessageMicro;";
    try {
    ......
}

How to solve this problem, will metadata.xml be used?, thank you

Best Answer

Answers

Sign In or Register to comment.