0

i am trying to implement the force update feature using app center, i have followed their documentation found here and it doesnt seem to work at all

here's the code inside the App Class

AppCenter.start(
        getApplication(), {APP SECRET HERE}, Crashes::class.java,
        Distribute::class.java, Analytics::class.java
    )

and i have tried uploading a build like this then downloading first, and after that i uploaded a newer version with higher version code / version name and set the checkbox for "Mandatory Update", i don't get any prompt at all to update when i start the app then.

Mahmoud Omara
  • 533
  • 6
  • 22
  • Make sure that you test your in-app update in release mode. If you are going to test this in debug mode then please follow this guide: https://learn.microsoft.com/en-us/appcenter/sdk/distribute/android#enable-in-app-updates-for-debug-builds – Anastasia Mar 10 '21 at 05:25
  • i have been testing in release mode, basically create release 1.0 version code 1 and download it, then create 2nd release with code 2 and upload it, supposedly when i open code 1 it will force me to update to 2 – Mahmoud Omara Mar 11 '21 at 10:28
  • Do you use Private or Public distribution group? If you use Private so you have to add this line to your project. https://learn.microsoft.com/en-us/appcenter/sdk/distribute/android#use-private-distribution-group – Anastasia Mar 12 '21 at 12:13
  • public groups, and i created an entirely new project to test this on – Mahmoud Omara Mar 13 '21 at 12:32
  • no idea whats wrong? i still cant seem to get it to work – Mahmoud Omara Apr 04 '21 at 12:05
  • Please, make sure that you: 1. Use the correct UpdateTrack type (if your group has prefix public in the list of groups on the App Center portal then you have to use UpdateTrack.PUBLIC otherwise UpdateTrack.PRIVATE). By default App Center SDK use the UpdateTrack.PUBLIC. 2. Check a new version in the release mode (otherwise please use https://learn.microsoft.com/en-us/appcenter/sdk/distribute/android#enable-in-app-updates-for-debug-builds). 3. Make sure that a new release has a higher value of versionCode and versionName. 4. Make sure that you use the right app-secret. – Anastasia Apr 05 '21 at 06:19
  • i have been trying on a public group and did all the steps as mentioned, it just won't work at all – Mahmoud Omara Apr 06 '21 at 10:14
  • 1
    You can take a look at the verbose logs and try to found logs with the possible issue by Distribute tag. https://learn.microsoft.com/en-us/appcenter/sdk/other-apis/android#adjust-the-log-level Also could you please clarify what the Android version and App Center SDK do you use? – Anastasia Apr 06 '21 at 13:34
  • the logs did help, posted the answer below – Mahmoud Omara Apr 07 '21 at 10:48

1 Answers1

0

Found the problem with the appcenter force update, AppCenter Distribute will not work on release mode if debuggable in gradle is set to true.

so make sure to leave it on false at the build type you will be testing on

debuggable false

adding this line before starting AppCenter showed me the logs that clued me to this.

AppCenter.setLogLevel(Log.VERBOSE)
Mahmoud Omara
  • 533
  • 6
  • 22