Menu
Who Do Is
  • Home
  • What
  • How
  • Is
  • Can
  • Are
  • Does
  • Do
  • Why
  • Who
  • Where
  • Which
  • Which
  • Should
  • Will
  • When
  • What’s
  • Did
Who Do Is

[ANSWERED] xamarin.forms – Razor Pay with Xamarin Forms

Posted on November 14, 2022

Solution 1 :

Just pasting this here so we can close the question.

You get this error java.lang.AbstractMethodError: abstract method "void com.google.android.gms.tasks.OnSuccessListener.onSuccess(java.lang.Object)" whenever your google play services packages is not compatible with the library you are trying to add.

So you would either have to change the version of your Google Play Services packages, or change the version of your AAR library file.

Problem :

I am trying to add Razor Pay to my Xamarin Form App, Though there is no direct way I created a binding Library from aar file.
as per Razor Pay document I added few line of code which is sufficient to work with test account but I am facing an Error which I am not sure how to solve it

Here is the Exception which is thrown

 com.google.android.gms.tasks.OnSuccessListener.onSuccess(java.lang.Object)

here is my call stack

07-12 21:36:07.276 D/com.razorpay.checkout( 9046): java.lang.AbstractMethodError: abstract method 
"void com.google.android.gms.tasks.OnSuccessListener.onSuccess(java.lang.Object)"
   07-12 21:36:07.276 D/com.razorpay.checkout( 9046):   at 
 com.google.android.gms.tasks.zzn.run(Unknown Source:4)
 07-12 21:36:07.276 D/com.razorpay.checkout( 9046):     at 
 android.os.Handler.handleCallback(Handler.java:873)
 07-12 21:36:07.276 D/com.razorpay.checkout( 9046):     at 
 android.os.Handler.dispatchMessage(Handler.java:99)

Here is my Code which i have implemented

public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity, IPaymentResultWithDataListener, IOnSuccessListener, IOnFailureListener
{
    public App app;

    protected override void OnCreate(Bundle savedInstanceState)
    {
        TabLayoutResource = Resource.Layout.Tabbar;
        ToolbarResource = Resource.Layout.Toolbar;

        base.OnCreate(savedInstanceState);
        Checkout.Preload(this);
        Checkout checkOut = new Checkout();
        checkOut.SetKeyID("MyAPIKEY");
        Forms.SetFlags("IndicatorView_Experimental");
        Xamarin.Essentials.Platform.Init(this, savedInstanceState);
        global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
        CachedImageRenderer.Init(true);
        Window.SetStatusBarColor(Android.Graphics.Color.Rgb(13, 141, 190));
        app = new App();
        LoadApplication(app);

        if (IsPlayServiceAvailable() == false)
        {
            throw new System.Exception("This device does not have Google Play Services and cannot receive push notifications.");
        }
        CreateNotificationChannel();
        LoginWithSocialIconViewModel.AuthenticateAction += OAuthGoogle;
        Window.SetSoftInputMode(Android.Views.SoftInput.AdjustResize);

        Activity activity = this;
        JSONObject options = new JSONObject();
        options.Put("description", "My Sample Payment activity");
        options.Put("order_id", "order_EAMgUyLXrMfbmL");
        options.Put("currency", "INR");
        options.Put("amount", "100");
        checkOut.Open(activity, options);
    }

Can someone figure it out what m I missing

READ  [ANSWERED] android - Create a simple exoplayer to stream video from url
Powered by Inline Related Posts

Comments

Comment posted by Saamer

You might have to update your google play services packages, it might not be compatible. What version are you using, and what version does razor pay recommend?

Comment posted by Ronak Shethia

@Saamer I downgraded my checkout arr file to 1.5.18 to 1.5.14 and it worked

Comment posted by Ronak Shethia

I downgraded my AAR file version and it worked well but my Google play service were updated to latest how I determined which version of Google play service would be compatible with my AAR library file ?

Comment posted by Saamer

You have to look at the details of the AAR library file. Check to see which version of the Play Services libraries it is using

Recent Posts

  • How can I play with my cat without toys?
  • What is a bag pipe band called?
  • Are Honda Civics actually fast?
  • Are Yankee candles toxic?
  • How do I pair my Michael Kors smartwatch with my Android?

Recent Comments

No comments to show.

Archives

  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuántas
  • ¿Cuánto
  • ¿Que
  • ¿Quién
  • 90” and 108” so you may have to round up to the nearest size.
  • and delete any Spotify folders from it. Once this is done
  • Android
  • Are
  • At
  • Bei
  • blink
  • C'est
  • Can
  • carbs
  • Comment
  • Did
  • Do
  • Does
  • During
  • For
  • Has
  • How
  • In
  • Is
  • Ist
  • Kann
  • Können
  • nouveau
  • On
  • or 108 inches.2020-08-03
  • Où
  • owning
  • Pourquoi
  • Puis-je
  • Quand
  • Quante
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • spiritual
  • tap the downward-facing arrow on the top left. A downward-facing arrow will appear underneath each song in the album; they'll turn green as the download completes.2020-07-28
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welcher
  • Welches
  • Welke
  • Wer
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Whose
  • Why
  • Wie
  • Will
  • Wo
  • Woher
  • you will receive two curtains each with the same measurements of width 66"" (168cm) x drop 54""(137cm).
  • you'll see a green downward-facing arrow next to each song.2021-02-26
©2023 Who Do Is | Powered by SuperbThemes & WordPress