1
votes

I am trying to create a Xamarin project using PayTM android library. Since PayTM doesn't have a direct Xamarin binding I have added the appinvokesdk-1.2.aar in the Xamarin Android Biding library project. The build action for appinvoke is "LibraryProjectZip". Now the appinvoke library also have a runtime dependency on easypay-8.7.3-appinvoke.aar (I found this after checking the pom file for appinvoke.aar file). I have set the build action for the easypay aar file as "EmbdedJar". I have also tried setting it to "LibraryProjectZip","ReferenceJar" and "EmbeddedReferenceJar". During runtime I am getting the error as

Java.Lang.ClassNotFoundException: Didn't find class "easypay.listeners.WebClientListener" on path: DexPathList[[zip file "/data/app/com.edmatix.poc.paytmdemo1-WQf3uMctjbNHoAG_ZfsH3A==/base.apk"],nativeLibraryDirectories=[/data/app/com.edmatix.poc.paytmdemo1-WQ…}

Here is my environment details

  • Visual Studio for Mac 8.5.4 (Build 12)
  • AndroidX assemblies
  • Xamarin.Form 4.6.0.726
  • Android Minimum API version 22
  • Android Target API 28 (Android 9)

the class easypay.listeners.WebClientListener is only required during run time and not during compile time.

Can you please help about how to properly embed the dependency library?

Thanks

2
Have you already enabled multi dex support?Saamer
I don't know how to enable that. Can you please guide me?Tiklu Ganguly
Depends on whether you are using a Mac or Windows i.stack.imgur.com/QqaV3.png but open the android project settings and enable multi dex.Saamer
Hi @Saamer , My app is using minimum API version as 21. So do you still think I need multi dex?Tiklu Ganguly
@Saamer, I was looking at this link devblogs.microsoft.com/xamarin/… .First of to be clear. I am not getting any compile time error. Also based on the link I shared, it seems, the Xamarin team have enabled some support so that we don't need multidex. Though I will still enable mulitdex and check it onceTiklu Ganguly

2 Answers

1
votes

so this is what I did to solve the issue of missing .aar file during runtime. I added the second .aar file (easypay-8.7.3-appinvoke.aar) into another Xamarin binding project (as shown in here) and set the compile type as LibraryProjectZip. And that solved my issue with not finding the class in runtime.

Thanks

1
votes

Please try to install Xamarin.Kotlin.StdLib in your Xamarin Android project. Installing the Kotlin package worked for me because I was using the .aar file which contains Kotlin code.

Install-Package Xamarin.Kotlin.StdLib -Version 1.3.50.1