2

Exception: "com.google.android.play.core.install.InstallException: Install Error(-3): The API is not available on this device"

Any solution to overcome this scenario? Thanks in advance.

        // Creates instance of the manager.
    appUpdateManager = AppUpdateManagerFactory.create(getApplicationContext());


    // Returns an intent object that you use to check for an update.
    com.google.android.play.core.tasks.Task<AppUpdateInfo> appUpdateInfoTask = appUpdateManager.getAppUpdateInfo();



    // Checks that the platform will allow the specified type of update.
    appUpdateInfoTask.addOnSuccessListener(new OnSuccessListener<AppUpdateInfo>() {
        @Override
        public void onSuccess(AppUpdateInfo appUpdateInfo) {
            Log.e("AVAILABLE_VERSION_CODE", appUpdateInfo.availableVersionCode()+"");

        }


    });

    appUpdateInfoTask.addOnFailureListener(new OnFailureListener() {
        @Override
        public void onFailure(Exception e) {
            Log.e("Error", "oops I am HERE in failure "+e);
        }
    });

    appUpdateInfoTask.addOnCompleteListener(new com.google.android.play.core.tasks.OnCompleteListener<AppUpdateInfo>() {
        @Override
        public void onComplete(com.google.android.play.core.tasks.Task<AppUpdateInfo> task) {
            Log.e("STATUS", "Completed");
        }
    });

    appUpdateManager.registerListener(installStateUpdatedListener);

2 Answers2

0

Possible solution might be replacing com.google.android.play.core.tasks.Task with Task.

Sakhawat Hossain
  • 454
  • 8
  • 23
0

Try to have a look here. In-App Update gives InstallException (ERROR_API_NOT_AVAILABLE) You will find your possible solution.

Though the In-App Update feature isn't highly recommended nowadays.

Sakhawat Hossain
  • 454
  • 8
  • 23