microsoft / appcenter-sdk-android

Development repository for the App Center SDK for Android
Other
274 stars 135 forks source link

Adopt target SDK 34 #1713

Closed MikhailSuendukov closed 7 months ago

MikhailSuendukov commented 9 months ago

Description

This pull request addresses key behavior changes in Android SDK 34 to ensure compatibility with the App Center SDK. Updates include the implementation of the RECEIVER_EXPORTED flag for runtime-registered broadcasts and the adaptation to new requirements for implicit and pending intents. This is achieved by using PendingIntent.FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT in the Distribute module. We've postponed increasing the SDK target version due to dependencies that must be updated to comply with new read-only requirements for dynamically-loaded files. In order to fix errors that occur when launching an application with SDK target 34, we used the flag values from the documentation.

Related PRs or issues

AB#102952

1709

D3zibel commented 8 months ago

Hi @MikhailSuendukov 🙂 Do you have any plans, when to release this branch? 🙂 I am currently facing issues, that the app crashes after updates from AppCenter due to a SecurityException which is caused by missing flags for braodcast receivers for Android 14 devices.

FATAL EXCEPTION: main Process: myapp.package, PID: 16533 java.lang.SecurityException: myapp.package: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts at android.os.Parcel.createExceptionOrNull(Parcel.java:3057) at android.os.Parcel.createException(Parcel.java:3041) at android.os.Parcel.readException(Parcel.java:3024) at android.os.Parcel.readException(Parcel.java:2966) at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:5684) at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1852) at android.app.ContextImpl.registerReceiver(ContextImpl.java:1792) at android.app.ContextImpl.registerReceiver(ContextImpl.java:1780) at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:755) at com.microsoft.appcenter.distribute.install.session.SessionReleaseInstaller.v(Unknown Source:25) at com.microsoft.appcenter.distribute.install.session.SessionReleaseInstaller.a(Unknown Source:0) at com.microsoft.appcenter.distribute.UpdateInstaller.a(Unknown Source:10) at com.microsoft.appcenter.distribute.Distribute.q0(Unknown Source:59) at com.microsoft.appcenter.distribute.ReleaseDownloadListener$3.run(Unknown Source:12) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:205) at android.os.Looper.loop(Looper.java:294) at android.app.ActivityThread.main(ActivityThread.java:8194) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971) Caused by: android.os.RemoteException: Remote stack trace: at com.android.server.am.ActivityManagerService.registerReceiverWithFeature(ActivityManagerService.java:13995) at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2570) at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2763) at android.os.Binder.execTransactInternal(Binder.java:1332) at android.os.Binder.execTransact(Binder.java:1278)

coveralls commented 7 months ago

Coverage Status

coverage: 100.0%. remained the same when pulling e49f00eea28b673b1b0600a3b98170568e9fb500 on adopt-sdk-target-34 into 9083e002d4e14473187b433b0aae6ad109cc9e82 on develop.

keithburgoyne commented 7 months ago

Very interested in having this PR released. We are also having issues with Android 14. Just wondering if there is an ETA.

troymccabe commented 7 months ago

@keithburgoyne Can you provide any additional detail on what manufacturers you're seeing this on? Curious if our experiences line up

keithburgoyne commented 7 months ago

@keithburgoyne Can you provide any additional detail on what manufacturers you're seeing this on? Curious if our experiences line up

It breaks on Pixel devices running SDK 34. I've heard reports it worked on Samsung devices running 14, but that's unverified.