5

I am trying to setup the in-app updates dialog in Android but it's not working from the example provided in the docs

I have tried the examples available in the docs which ask you to do this.

appUpdateManager
    .getAppUpdateInfo()
    .addOnSuccessListener(
        new OnSuccessListener<AppUpdateInfo>() {
            @Override
            public void onSuccess(AppUpdateInfo appUpdateInfo) {
                if (appUpdateInfo.updateAvailability() == UpdateAvailability.DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS) {
                    // If an in-app update is already running, resume the update.
                    try {
                        appUpdateManager.startUpdateFlowForResult(
                            appUpdateInfo,
                            IMMEDIATE,
                            MainActivity.this,
                            MY_REQUEST_CODE);
                    } catch (IntentSender.SendIntentException e) {
                        e.printStackTrace();
                    }
                }
            }
    }).addOnFailureListener(new OnFailureListener() {
        @Override
        public void onFailure(Exception e) {
            Log.e(TAG, "onFailure: onResume" + e.getMessage() );
        }
    });

Expected a result that tells gives me some option where it tells me that an updates is actually available. But it directly gives me the error unable to bind to the service.

Fábio Nascimento
  • 2,644
  • 1
  • 21
  • 27
muchamaze
  • 173
  • 1
  • 4
  • 14

2 Answers2

7

There seems to be an issue with Google Play Core library with Android Virtual Devices. please use the Real Device

luffynas
  • 69
  • 2
  • 4
0

I have disabled the google play store application, and I am getting the same error after this every time I am opening the app on which I am performing this In-App update testing. A very weird implementation has been provided by Google.

Gaurav Arora
  • 8,282
  • 21
  • 88
  • 143