There was a problem with activating the app web definition cannot complete this action SharePoint Online

In this SharePoint Apps or Add-in tutorial explains how to solve “Error occurred in deployment step ‘Install SharePoint Add-in’: Failed to install SharePoint Add-in. Please see the output window for details. There was a problem with activating the app web definition. Cannot complete this action.” The error comes while developing SharePoint hosted add-in or apps using visual studio 2017 for SharePoint Online or SharePoint 2013/2017.

Recently in a SharePoint training, I was explaining about SharePoint hosted add-in development and deployment using visual studio 2017, but while deploying I got the error: Error occurred in deployment step ‘Install SharePoint Add-in’: Failed to install SharePoint Add-in. Please see the output window for details.

There was a problem with activating the app web definition. Cannot complete this action
There was a problem with activating the app web definition. Cannot complete this action

When I checked the output window, I can see an error like: There was a problem with activating the app web definition. Cannot complete this action.

There was a problem with activating the app web definition sharepoint 2013
There was a problem with activating the app web definition sharepoint 2013

If you are new to SharePoint hosted add-in or apps, you can read below two tutorials:

Reason:

In the SharePoint hosted add-in I was creating a site column, content type and then I was creating a SharePoint custom list. Then in that list, I was trying to add the content type in SharePoint Online.

Solution:

Not sure, if it the solution will work every time. But it worked for me.

  • First I retract the app and clean the solution in visual studio 2017.
  • Then I deleted the content type and SharePoint Online list from the Add-in project.
  • And finally, I created the content type and added the existing Site columns to the content type.
  • Then created the SharePoint custom list to the add-in project and added the content type to the list.
  • Then I deployed the project. This time it deployed the Add-in correctly without giving any error.

You can read some SharePoint hosted add-in errors:

This SharePoint tutorial, I explained how to resolve the error: Error occurred in deployment step ‘Install SharePoint Add-in’: Failed to install SharePoint Add-in. Please see the output window for details. There was a problem with activating the app web definition. Cannot complete this action, while deploying SharePoint hosted add-in to SharePoint online developer site.

>