checkout / frames-android

Frames Android: making native card payments simple
https://www.checkout.com/docs/integrate/sdks/android-sdk
MIT License
47 stars 33 forks source link

CheckoutSettings.getProviderMode()' on a null object reference #141

Closed qamarkhanInnovo closed 1 year ago

qamarkhanInnovo commented 1 year ago

Hello checkout team. we are getting this error on some devices also we provide all the necessary details while initialise the sdk.

binding.checkoutCardForm.set3DSListener(m3DSecureListener)
            .setEnvironment(if (BuildConfig.DEBUG) Environment.SANDBOX else Environment.LIVE)
            .setKey(if (BuildConfig.DEBUG) BuildConfig.PAYMENT_GATEWAY_ENVIRONMENT_SANDBOX else BuildConfig.PAYMENT_GATEWAY_ENVIRONMENT_LIVE)

Fatal Exception: java.lang.NullPointerException Attempt to invoke virtual method 'com.oppwa.mobile.connect.provider.Connect$ProviderMode com.oppwa.mobile.connect.checkout.meta.CheckoutSettings.getProviderMode()' on a null object reference. com.oppwa.mobile.connect.checkout.dialog.BaseServiceActivity$1.onServiceConnected (Unknown Source:55)

please reply us ASAP our app is already in production mode.

maxim-nosov-cko commented 1 year ago

Hi @qamarkhanInnovo. From provided information, it's hard to say what the issue is and how it's related to native frames-android SDK. Could you please provide a full stacktrace?

qamarkhanInnovo commented 1 year ago

Hello @maxim-nosov-cko. This issue report from firebase crashlytics. this is the full stracktrace which i got from there. After this i go to the checkout sdk implementation and verify my implementation according to provided documentation, its all okay.

--> com.oppwa.mobile.connect.checkout.meta.CheckoutSettings.getProviderMode()' on a null object reference. (then i go to checkout setting class and check what is provided mode ? you could check below i provided code).

public class CheckoutSettings implements Parcelable {
    @NonNull
    private String a;
    private String b;
    @NonNull
    private ProviderMode c;

this is provider mode enum class

public static enum ProviderMode {
        LIVE,
        TEST;

        private ProviderMode() {
        }
    }

if you check my above comment where i send mode like .setEnvironment(if (BuildConfig.DEBUG) Environment.SANDBOX else Environment.LIVE) live or sandbox. i dont know why this issue comes on some devices and other are okay. i used this sdkimplementation 'com.github.checkout:frames-android:3.0.1'

Screenshot_2022-10-31-11-48-02-74_40deb401b9ffe8e1df2f1cc5ba480b12

patrick-hoban-cko commented 1 year ago

Hi @qamarkhanInnovo, seeing as this issue is quite old, I'd recommend upgrading to the latest version of our Android SDK (v4.0.2), to see if that resolves it.

I will close this ticket for now, but if you continue to face the issue after using the newest version, please do raise another ticket.

Best,

Patrick