Search code examples
c#xamarinxamarin.formsxamarin.androidvisual-studio-2019

Android Binding Library project library reference error, Mono.Android, Version=0.0.0.0


I have a cross platform project created on VS2017(15.9.22) community and later on moved to VS2019(16.5.4) Community . I am trying to implement an Indian payment gateway, called RazorPay. It supports native android sdk , so they provide aar files. And I am using that aar file via Binding Library.

Initially I started my project in 2017 Community but later on switched to 2019 edition hoping it will a more stable version with latest support for Xamarin android and its SDK. Anyways, My Project has a .Net Standard Project with Android Project as well. .net Standard was 2.0, which after upgrading , I changed to 2.1 as I was getting a mismatch error.

Later on , in VS2019 , I created a new Binding Library project and build that rar file using BuildAction = LibraryProjectZip. As with other options it was not usable. Not able to use it in code. Also I need to add these two lines in order to make build successful.

<remove-node path="/api/package[@name='com.razorpay']/interface[@name='PaymentResultListener']" />
 <add-node path="/api/package[@name='com.razorpay']/interface[@name='PaymentResultWithDataListener']" />

After adding it to both the projects (standard& android), I am calling this dll in one of the xaml file of Standard Project. But now I am getting errors. I am attaching all required screenshots here. Please help me out. I am fairly new developer with Xamarin and Cross Platform environment. Following are the screenshots of settings

  1. Error enter image description here

  2. Android Project

enter image description here

  1. Binder Project enter image description here

  2. .Net Standard Project

    enter image description here


Solution

  • It was fixed by adding/updating required project reference from Nuget package manager. Also removing bin/obj and rebuilding of both the projects did the trick.