When working with SharePoint Apps in Visual Studio 2013, you might receive the following error during deployment.
App installation encountered the following errors:
ErrorDetail: There was an error during the operation.
ExceptionMessage: RestrictAssociationToId - ListId Lists/ListName
SourceName: Common App Deployment
Error occurred in deployment step 'Install app for SharePoint': Failed to install app for SharePoint. Please see the output window for details.
Although there are a number of causes for this, I find that these are typically related to dependencies in your Feature Manager. Take a look at mine below.
As you can see for some reason, my list is not included in the package. Although this example is simple, it’s not uncommon when you start dealing with multiple features and lists. The specific ExceptionMessage trictAssociationToId - ListId Lists/ListName is because I have a workflow associated with the list, but the list is not getting deployed. Once I add the list back to the feature, the issue goes away.
If you start receiving errors like this go back and look at your feature manager and make sure everything in your project is getting deployed in the order you want.