Appcenter-sdk-dotnet: [Android] Distribute in-app updates not working when app minSdkVersion is 26

Created on 14 Jan 2019  路  12Comments  路  Source: microsoft/appcenter-sdk-dotnet

Description

I followed the steps to activate the Distribute module together with in-app updates.

When I download and install the app on the device, a browser window opens with the notification "In-app updates enabled! Returning to the app in 3, 2, 1....". All good so far. However when I close and re-open the app, the same thing happens again.
Also when a new version is distributed, the app doesn't receive any notification (which would make sense if the app is not properly registered to receive in-app updates).

I've seen ticket #719 and #720 and I am using Google Chrome in the steps mentioned above. Any idea what is causing this behaviour?

Details

  1. What is your app platform (Xamarin.Android or Xamarin.iOS or UWP)?

    • Android

  2. Which SDK version are you using?

    • AppCenterSDK 1.9.0, 1.10.0, 1.11.0

    • AndroidSDK 27

  3. Which OS version did you experience the issue on?

    • Android 8.1.0, 9

  4. What device version did you see this error on? Were you using an emulator or a physical device?

    • Pixel 2 XL physical device, Huawei P20 physical device

support

Most helpful comment

Ok, good to hear.
Just so you know, I'm fine with setting the mindSdkVersion to 24.

All 12 comments

Hi there, what could help is having the console logs emitted by the SDK to understand why you are experiencing such behavior. Can you please adjust the SDK's log level to verbose as described in this documentation? You will see SDK's logs in your IDE's device console, it should be logcat for Android. Thanks

Just wondering but are you aware of anything that could prevent the SDK from writing to the app's local storage or getting values from it?

@clpolet, thanks for the response. Here is what the logs give me:

I/AppCenter: Distribute service started from application.
D/AppCenterDistribute: InstallerPackageName=com.google.android.packageinstaller
D/AppCenterDistribute: No token, need to open browser to url=...
V/AppCenter: { ... }
D/AppCenterDistribute: com.microsoft.appcenter.distribute.DeepLinkActivity.getIntent()=Intent { ... }
D/AppCenterDistribute: Intent requestId=c8cb21c9-961b-471e-a64d-a7f0fe800f1d
D/AppCenterDistribute: Intent distributionGroupId=00000000-0000-0000-0000-000000000000
D/AppCenterDistribute: Intent updateToken passed=true
D/AppCenterDistribute: Intent updateSetupFailed passed=false
D/AppCenterDistribute: Intent testerAppUpdateSetupFailed passed=false
D/AppCenterDistribute: Stored redirection parameters.
D/AppCenterDistribute: Get latest release details...
D/AppCenterDistribute: Check if we need to report release installation..
D/AppCenterDistribute: Current release was already reported, skip reporting.
V/AppCenterDistribute: Calling https://api.appcenter.ms/v0.1/sdk/apps/...
V/AppCenterDistribute: Headers: {x-api-token=********************************12b463c1}
V/AppCenterDistribute: Already checking or checked latest release.
E/AppCenterDistribute: Failed to check latest release:
    org.json.JSONException: No value for android_min_api_level
        at org.json.JSONObject.get(JSONObject.java:392)

I'm not sure why it ends with the error No value for android_min_api_level.

Regarding:

Just wondering but are you aware of anything that could prevent the SDK from writing to the app's local storage or getting values from it?

Should I explicitly enable any permissions to use the Distribute feature?

I also see I posted my Issue in the wrong project, it should have been: AppCenter-SDK-Android

Well, I seemed to have found the cause of the problem. In my gradle file, the minSdkVersion was set to the following minSdkVersion 26. Setting this value to 24 fixed the problem.

Should this maybe be mentioned somewhere in the documenation?

Hi @Sjiep, thanks for logs that really helps. From the JSONException seen it feels like a SDK/server communication issue. We are actively investigating it. Though it's quite a surprise to see that the minSdkVersion have fixed the issue it feels unrelated. Anyways, we'll keep you posted.

A quick update, the issue is happening server side and we are still working on the fix.

Ok, good to hear.
Just so you know, I'm fine with setting the mindSdkVersion to 24.

Also FYI the fix for minSdkVersion 26 is live :).

I am having similar issues with appcenter inapp updates. For some reason, my application is not updating on Android version 5.1 but is updating on Android version 7.0

@dotfig Do you also have the same error message on your device?

E/AppCenterDistribute: Failed to check latest release:
    org.json.JSONException: No value for android_min_api_level
        at org.json.JSONObject.get(JSONObject.java:392)

Could you please post your device logs?

please see refer to this issue https://github.com/Microsoft/AppCenter-SDK-Android/issues/948

this issue can be closed

Was this page helpful?
0 / 5 - 0 ratings