Share via

problems in binding a library to xamarin.android

mc 7,106 Reputation points
2021-04-07T09:24:51.94+00:00
public static interface OnMapScreenShotListener {
    void onMapScreenShot(Bitmap param1Bitmap);

    void onMapScreenShot(Bitmap param1Bitmap, int param1Int);
  }

this is the android code and there will be an error

IOnMapScreenShotListenerImplementor” already contains definition of “OnMapScreenShotHandler

there will be two EventHandler for the two methods

how to fix it?

Developer technologies | .NET | Xamarin
0 comments No comments

Answer accepted by question author

Anonymous
2021-04-07T11:46:05.123+00:00

Hello,​

Welcome to our Microsoft Q&A platform!

First, open your binding project, find the Transforms folder, then open it, find the Metadata.xml, open it, add You can add following format code. please replace {package_name} with your binding package name.

   <attr path="/api/package[@name='{package_name}']/interface[@name='{IOnMapScreenShotListenerImplementor}']" name="OnMapScreenShotHandler">NewOnMapScreenShotHandler</attr>  

Because I do not have your library, according to the attribute in the Metadata.xml

Best Regards,

Leon Lu


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.