developermypos/myPOS-SDK-Android

[Stable 1.0.2] Unusable with Android 11: Toast.getView() is deprecated

Closed this issue · 3 comments

With Android 11 (API Level 30) toast.getView() was deprecated (see documentation)

This leads to a NullpointerException when calling POSHandler.getInstance() making the whole SDK unusable on Android 11.

java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference
        at com.mypos.slavesdk.POSHandler.setDefaultInfoListener(POSHandler.java:180)
        at com.mypos.slavesdk.POSHandler.<init>(POSHandler.java:170)
        at com.mypos.slavesdk.POSHandler.getInstance(POSHandler.java:147)

Hi,

Please try our beta version. This and other issues are fixed there.

implementation 'com.mypos:slavesdk-beta:2.0.7'

It works with the beta version, but I don't want to use a 2-year-old beta in a production environment.

Looking at the commit history, this bug was fixed in the beta version about 5 months ago.
Why was this critical bug not fixed in the stable release?

The 'beta' version is stable enough, so we are planning to merge it to the 'master' very soon.