Açıklama:
OneSignal kütüphanem 5.1.9, internette araştırdım bu sorunu yaşayanlar kütüphanelerini güncellediğinde hatanın çözüldüğünü söylüyor ancak kütüphanem zaten en son sürümde. Android 12 ve üzeri sürümlerde bu hatayı alıyorum:
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.
Gradle
compileSdkVersion 34
minSdkVersion 21
targetSdkVersion 34
implementation com.onesignal:OneSignal:5.1.19
Logcat'in tamamı:
08-11 17:19:56.453 8611 8611 E AndroidRuntime: FATAL EXCEPTION: main
08-11 17:19:56.453 8611 8611 E AndroidRuntime: Process: , PID: 8611
08-11 17:19:56.453 8611 8611 E AndroidRuntime: java.lang.RuntimeException: Unable to start receiver com.onesignal.GcmBroadcastReceiver: java.lang.IllegalArgumentException:: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
08-11 17:19:56.453 8611 8611 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:936)
08-11 17:19:56.453 8611 8611 E AndroidRuntime: Caused by: java.lang.IllegalArgumentException: : Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
08-11 17:19:56.453 8611 8611 E AndroidRuntime: ... 9 more