microsoft / appcenter-sdk-android

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

Distribute crash when targetSDK is set to android 14 #1709

Closed npresseault closed 7 months ago

npresseault commented 10 months ago

Description

Distribute crashes when trying to get a version update. Set your target SDK to 34 (Android 14)

One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when registering the receiver, I believe right here: https://github.com/microsoft/appcenter-sdk-android/blob/46e6bf21ee208e30c568b094d057b1820086f9c5/sdk/appcenter-distribute/src/main/java/com/microsoft/appcenter/distribute/install/session/SessionReleaseInstaller.java#L236

Ref: https://developer.android.com/about/versions/14/behavior-changes-14#runtime-receivers-exported

Repro Steps

  1. Set your target SDK to 34 (Android 14)
  2. Receive an app update, app downloads, install but crashes after that.

Details

  1. Which SDK version are you using?
    • 5.0.2
  2. Which OS version did you experience the issue on?
    • Android 14
  3. What device version did you see this error on? Were you using an emulator or a physical device?
    • Pixel 5
  4. What third party libraries are you using?
    • Not relevant
  5. Please enable verbose logging for your app using AppCenter.setLogLevel(Log.VERBOSE) before your call to AppCenter.start(...) and include the logs here:
Fatal Exception: java.lang.SecurityException: xxxxxxxxxxxxxx: 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.registerListeners(SessionReleaseInstaller.java:236)
       at com.microsoft.appcenter.distribute.install.session.SessionReleaseInstaller.install(SessionReleaseInstaller.java)
       at com.microsoft.appcenter.distribute.UpdateInstaller.install(UpdateInstaller.java:93)
       at com.microsoft.appcenter.distribute.Distribute.setInstalling(Distribute.java:1931)
       at com.microsoft.appcenter.distribute.ReleaseDownloadListener$3.run(ReleaseDownloadListener.java:97)
       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:8177)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
MikhailSuendukov commented 9 months ago

Hi @npresseault and thank you for reaching out to us. I was able to reproduce this error, it seems to be related to a change in security protocols in Android SDK version 34. I created a ticket on our dashboard.

fabiendem commented 8 months ago

Hi, can we consider this issue to be covered by https://github.com/microsoft/appcenter-sdk-android/pull/1713 ? Do you have ETA for the merge?

ETLopes commented 8 months ago

Hi! Just commenting to know if there is any deadline for it?

avelycure commented 8 months ago

Hello! How are you? Is there any progress in the task?

troymccabe commented 7 months ago

@MikhailSuendukov with #1713 merged, when can we expect a release with this included?

keithburgoyne commented 7 months ago

Any chance this will be released soon? Our beta flow is broken for Android 34 devices.

MikhailSuendukov commented 7 months ago

Hi, we have planned to release this week.

troymccabe commented 7 months ago

@MikhailSuendukov sorry to be a bother, but we're starting to get a ton of feedback as users are updating. I see the tag is created, but when can we expect a release available that gradle can grab?

DmitriyKirakosyan commented 7 months ago

This fix has been released in v5.0.4, so I'm closing this issue. Let me know if updating sdk version doesn't help.

claudioredi commented 4 months ago

@DmitriyKirakosyan I don't see v5.0.4 released yet. Am I missing something?

https://www.nuget.org/packages/Microsoft.AppCenter.Distribute

fabiendem commented 4 months ago

(It's on maven for sure) https://mvnrepository.com/artifact/com.microsoft.appcenter/appcenter-distribute/5.0.4 https://github.com/microsoft/appcenter-sdk-android/releases

claudioredi commented 4 months ago

@fabiendem but it didn't reach nuget, I don't have any update available from 5.0.3. I'm totally lost. Thoughts @keithburgoyne / @DmitriyKirakosyan ?

MikhailSuendukov commented 4 months ago

Hi @claudioredi! Apparently you are trying to find AppCenter SDK .NET 5.0.4. That this fix has not yet been released for the AppCenter SDK .NET (currently the latest version is 5.0.3), only for the AppCenter SDK Android (5.0.4).

claudioredi commented 4 months ago

@MikhailSuendukov would you mind sharing a nuget link to AppCenter SDK Android 5.0.4? I'm afraid that I don't find it.

natevarghese commented 4 months ago

I am also looking for this 5.0.4 Nuget. The same error also affects Crashes and Analytics.   Google says the targetSdk will need to be 34+ for new apps and app updates by August 31, 2024.  https://developer.android.com/google/play/requirements/target-sdk   This deadline is significantly before the app center retirement date of March 31, 2025. Without making this Nuget available, it effectually pushes the retirement date up to August 31, 2024.

DmitriyKirakosyan commented 4 months ago

@claudioredi, This repository is for the AppCenter native Android SDK. The latest version available on Maven is 5.0.4. The .NET wrapper, which includes support for Android among other platforms, is hosted in a separate repository and follows separate versioning. The latest available version for the .NET Android SDK is 5.0.3.

SarthakB26 commented 3 months ago

I am also looking for this 5.0.4 Nuget. The same error also affects Crashes and Analytics.   Google says the targetSdk will need to be 34+ for new apps and app updates by August 31, 2024.  https://developer.android.com/google/play/requirements/target-sdk   This deadline is significantly before the app center retirement date of March 31, 2025. Without making this Nuget available, it effectually pushes the retirement date up to August 31, 2024.

did you find any workaround for Xamarin/MAUI