android – In-app updates not working. Unable to bind the service error-ThrowExceptions

Exception or error:

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.

How to solve:

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

Leave a Reply

Your email address will not be published. Required fields are marked *