Resolving: ‘the app for SharePoint is in an invalid state and cannot be uninstalled’

I was having a problem with deploying my SharePoint Hosted App into my Dev SharePoint environment. Where it just kept waiting for the removal to complete and clearly after 15 minutes wasn’t going to. There is no cancel or stop button in Visual Studio so I had to take matters into my own hands by forcing restarting IIS and finally Visual Studio stopped trying.

Then this came up in Visual Studio…

image

Error    1    Skipping the uninstall step because the app for SharePoint is in an invalid state and cannot be uninstalled.
        0    0   

Error    2    Error occurred in deployment step ‘Install app for SharePoint’: The provided App differs from another App with the same version and product ID.
        0    0    UbertTaskListAngularApp

Unfortunately there was also no force remove or stop remove in SharePoint either!

image

So I tried to force the deployment by incrementing my App Manfiest Version value based on a recommendation by Leon Zandman on a previous blog post I’d written on this subject here.

image

and then got this error

—— Build started: Project: UbertTaskListAngularApp, Configuration: Debug Any CPU ——
  Successfully created package at: c:\tfs\demos\UbertTaskListAngularApp\UbertTaskListAngularApp\bin\Debug\UbertTaskListAngularApp.debugapp
—— Deploy started: Project: UbertTaskListAngularApp, Configuration: Debug Any CPU ——
Active Deployment Configuration: Deploy App for SharePoint
  Skipping deployment step because a pre-deployment command is not specified.
  Skipping the uninstall step because the app for SharePoint is in an invalid state and cannot be uninstalled.
  Install app for SharePoint:
  Uploading the app for SharePoint…
Error occurred in deployment step ‘Install app for SharePoint’: An instance of this App already exists at the specified location.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

 

I noticed that my Windows Services were down including the SharePoint Timer Service and I tried starting them all with no joy…

image

…so I actually just restarted the whole environment and when Windows came back up and I went to the SharePoint Site…the App was gone ;-)

Opening up Visual Studio 2013 again and F5’ing got me back up and running ok.

One thought on “Resolving: ‘the app for SharePoint is in an invalid state and cannot be uninstalled’”

Leave a Reply