microsoft / appcenter-sdk-android

Development repository for the App Center SDK for Android
Other
277 stars 134 forks source link

Installation of mandatory update is stuck after cancel confirmation dialog #1619

Closed fabiendem closed 2 years ago

fabiendem commented 2 years ago

Description

On Android 8 (Level 26 and later), when we want to install an update, we are prompted with an alert to grant the permission to "Draw over other apps".

Piece of code at https://github.com/microsoft/appcenter-sdk-android/blob/80592335a068cdfa09c6fd684a67fed5b77c824a/sdk/appcenter-distribute/src/main/java/com/microsoft/appcenter/distribute/Distribute.java#L1631-L1687

When the alert is displayed, if the user taps on anything but the two buttons, the alert dismisses, but then the app is stuck on an alert saying "Installing...". It's not even possible to kill the app from the "recent apps" screen.

See this video:

https://user-images.githubusercontent.com/1186282/165573886-5114463b-8395-4aba-829e-eced33bd04b7.mp4

Repro Steps

Please list the steps used to reproduce your issue.

  1. On Android 12 (normally this should be Android 8 (Level 26) and later, but I tested on Android 12, Pixel 6.
  2. Install a first version v0 of the app from AppCenter
  3. Enable an update v1 on AppCenter as mandatory
  4. Launch the app
  5. Download the update, accept unknown sources
  6. When the alert which says "For security, your device is set to block start application after update.", tap outside the alert.
  7. App will be stuck

Details

  1. Which SDK version are you using?
    • 4.4.3
  2. Which OS version did you experience the issue on?
    • Android 12
  3. What device version did you see this error on? Were you using an emulator or a physical device?
    • Google Pixel 6
  4. What third party libraries are you using?
    • N/A
  5. Please enable verbose logging for your app using AppCenter.setLogLevel(Log.VERBOSE) before your call to AppCenter.start(...) and include the logs here:
aleksandr-dorofeev commented 2 years ago

Hello @fabiendem , thank you for getting in touch with us! It looks like a duplicate. I will close this issue. Feel free to reopen it in case of any questions.

fabiendem commented 2 years ago

OK, I see now

MatkovIvan commented 2 years ago

It's a different problem. Reopened, renamed to make the case more clear

fabiendem commented 2 years ago

Just curious, is this being fixed by one the PRs you've recently merged? https://github.com/microsoft/appcenter-sdk-android/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Amerged

MatkovIvan commented 2 years ago

It will be in the next one, I'll link PR with this issue.

JFYI - the root problem is that android doesn't catch this event at all, so some workarounds required from our side.

fabiendem commented 2 years ago

Thank you. I see all your recent PRs, you're crushing it, thanks for considering the feedback we provide 🙏

DmitriyKirakosyan commented 2 years ago

The fix has been released! I'm closing the issue, but feel free to reopen if you face it again.