developermypos / myPOS-SDK-Android

myPOS SDK Android enabling to integrate Apps with myPOS Card Terminals for Card Payments processing
49 stars 22 forks source link

Android 12 Flag_Immutable #18

Closed pateras95 closed 1 year ago

pateras95 commented 2 years ago

Trying to run your APK after build on Android 12 phone and we get this error :

Process: com.example.mypos, PID: 6417
java.lang.IllegalArgumentException: com.example.mypos: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
    at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
    at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:651)
    at android.app.PendingIntent.getBroadcast(PendingIntent.java:638)
    at com.pax.gl.commhelper.impl.u.a(SourceFile:1344)
    at com.pax.gl.commhelper.impl.u.connect(SourceFile:251)
    at com.mypos.slavesdk.PaxUsbConnectionHandler$1.run(PaxUsbConnectionHandler.java:119)
    at java.lang.Thread.run(Thread.java:920)
StiliyanKovachev commented 2 years ago

Hi,

are you using 2.1.0 myPOS sdk version?

pateras95 commented 2 years ago

Slave sdk for myPOS is on 2.0.9 version if i am correct and this is the myPOS sdk, i intrergrated from the tutorial

StiliyanKovachev commented 2 years ago

please update your dependency to implementation 'com.mypos:slavesdk:2.1.0'

StiliyanKovachev commented 2 years ago

@pateras95 sorry I've got your point. The fix will be available in the new version.

StiliyanKovachev commented 1 year ago

version 'com.mypos:slavesdk:2.1.2' is live now. Please update