microsoft / appcenter-sdk-android

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

App downloaded from In-app-update won't detect another update #1594

Closed Mr777Nick closed 2 years ago

Mr777Nick commented 2 years ago

Description

I've been using the in-app-update feature for about 9 months, it worked perfectly fine. then around 2-3 weeks ago when the SDK is updated to 4.4.1 and 4.4.2, the application which downloaded from within the in-app-update, won't detect future updates. There's no dialog whatsoever that says there's an update, even though it exists.

Repro Steps

  1. Build the current app (v1.0) and distribute it from within the App Center
  2. Download the app from the App Center (v1.0), then install it
  3. Build and distribute another update (v1.1)
  4. Open the app (v1.0), it would detect the update, then install it, this process will work fine
  5. Build and distribute another update (v1.2)
  6. Open the app(v1.1), the app won't detect the update, at this point any other updates won't be detected by the app. However, if I uninstall the currently installed app, then redownload the app (v1.1) from within the App Center, the app would detect the update (v1.2) with no issues.

It seems like the download APK/Application from within the in-app-update is broken or something that causes the app to not be able to download the update.

Details

  1. Which SDK version are you using?
    • 4.4.2
  2. Which OS version did you experience the issue on?
    • Android 11, Android 10, Android 8
  3. What device version did you see this error on? Were you using an emulator or a physical device?
    • Realme 5 Pro, Infinix Hot 10, Android Studio Emulator
  4. What third party libraries are you using?
    • None added since the last App Center SDK updated
  5. Please enable verbose logging for your app using AppCenter.setLogLevel(Log.VERBOSE) before your call to AppCenter.start(...) and include the logs here: Will upload the log later. EDIT: Here's the link to the log
AnastasiaKubova commented 2 years ago

Hi, @Mr777Nick ! Thanks for getting in touch with us! I was able to reproduce your issue and will label this issue as a bug. I can suggest you a workaround for this issue. Please try to add the package name of your application via this API before App Center start:

Distribute.addStores(new HashSet<String>() {
    { add("com.your.package"); }
});

and let me know about the results?

Mr777Nick commented 2 years ago

Hi, @Mr777Nick ! Thanks for getting in touch with us! I was able to reproduce your issue and will label this issue as a bug. I can suggest you a workaround for this issue. Please try to add the package name of your application via this API before App Center start:

Distribute.addStores(new HashSet<String>() {
    { add("com.your.package"); }
});

and let me know about the results?

Hey @AnastasiaKubova, thanks for your help, the workaround does fix this issue for now, I'll keep using it until the fixed version is released. Thanks again!

clhols commented 2 years ago

@AnastasiaKubova Isn't it worth creating a 4.4.3 release just for this fix? It seems odd that this kind of bug has been out there for so long.

AnastasiaKubova commented 2 years ago

Hi! Thanks for getting in touch with us! This bug has a workaround. We notify you when the fix will be released.

clhols commented 2 years ago

But everyone updating to the newest SDK version will encounter this issue and have to find this GitHub issue and implement the workaround. It would be best if you released a new version quickly to avoid new users and updaters to experience this bug and use time and resources to debug and implement the workaround.

fabiendem commented 2 years ago

Hey +1 to @clhols

@AnastasiaKubova In the CHANGELOG.md and releases could you please at least flag the versions which have this bug? This is a critical bug. 🐛

Consider scenarios where it's not just one or two devices to update but 100s. Here since you can't download update, the app is "bricked". The fix is fine if you're aware of it, but once the broken SDK is part of the latest update, the app will be stuck in this state.

Cheers

DmitriyKirakosyan commented 2 years ago

Hi @fabiendem , we've updated the CHANGELOG.md and Release information. Thank you!

fabiendem commented 2 years ago

Thanks

aballano commented 2 years ago

Hi, @Mr777Nick ! Thanks for getting in touch with us! I was able to reproduce your issue and will label this issue as a bug. I can suggest you a workaround for this issue. Please try to add the package name of your application via this API before App Center start:

Distribute.addStores(new HashSet<String>() {
    { add("com.your.package"); }
});

and let me know about the results?

Thank you for the workaround, unfortunately it seems that API wasn't added for the no-op version (appcenter-distribute-play) so I guess to make this work is better to stay in 4.4.1 and wait for 4.4.3?

TedaLIEz commented 2 years ago

This issue exists from 3.3.0, because the LOCAL_STORE filter the application's id itself, so every time the application tries to install the in-app update from itself, it will return true when we check isInstalledFromAppStore in the Distribute API, and then skip the update. image image

Besides, addStores is not available in no-op version, what should we do?

DmitriyKirakosyan commented 2 years ago

Hi folks, we just released a new version with this fix included.