exponea / exponea-flutter-sdk

MIT License
7 stars 9 forks source link

Android 15 (sdk 34) crash whan calling `requestPushAuthorization()` #23

Closed simonh-bourne closed 3 months ago

simonh-bourne commented 3 months ago

Updating targetSdkVersion to 34 in host app build gradle results in plugin crashing when requesting push authorization.

Google requires apps to be updated to target SDK34 by August 31 2024.

Crash dump as follows :

E/Exponea (24675): Exponea Safe Mode wrapper caught unhandled error E/Exponea (24675): java.lang.SecurityException: com.bourne.haven.debug: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts E/Exponea (24675): at android.os.Parcel.createExceptionOrNull(Parcel.java:3183) E/Exponea (24675): at android.os.Parcel.createException(Parcel.java:3167) E/Exponea (24675): at android.os.Parcel.readException(Parcel.java:3150) E/Exponea (24675): at android.os.Parcel.readException(Parcel.java:3092) E/Exponea (24675): at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:5860) E/Exponea (24675): at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1853) E/Exponea (24675): at android.app.ContextImpl.registerReceiver(ContextImpl.java:1793) E/Exponea (24675): at android.app.ContextImpl.registerReceiver(ContextImpl.java:1781) E/Exponea (24675): at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:757) E/Exponea (24675): at com.exponea.sdk.receiver.NotificationsPermissionReceiver$Companion$requestPushAuthorization$$inlined$runOnBackgroundThread$1.invokeSuspend(Extensions.kt:465) E/Exponea (24675): at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) E/Exponea (24675): at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) E/Exponea (24675): at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) E/Exponea (24675): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) E/Exponea (24675): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) E/Exponea (24675): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) E/Exponea (24675): Caused by: android.os.RemoteException: Remote stack trace: E/Exponea (24675): at com.android.server.am.ActivityManagerService.registerReceiverWithFeature(ActivityManagerService.java:14469) E/Exponea (24675): at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2648) E/Exponea (24675): at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2822) E/Exponea (24675): at android.os.Binder.execTransactInternal(Binder.java:1500) E/Exponea (24675): at android.os.Binder.execTransact(Binder.java:1444)

simonh-bourne commented 3 months ago

In response to an offline message, it is the host app android/app/build.gradle that is being updated to targetSdkVersion 34

SDK versions are exponea: ^1.6.0

Flutter (Channel stable, 3.22.0

roland-misica commented 3 months ago

H @simonh-bourne, thanks for reporting the issue.

We found the root cause in the native Android SDK and it was fixed in 3.14.0. We will update native SDKs in the next release to resolve this issue.

simonh-bourne commented 3 months ago

What is the timescale for the Flutter library update?

xcibik00 commented 3 months ago

Hi @simonh-bourne - already available in 1.7.0 version of our Exponea Flutter SDK