While trying to import a managed solution I was getting the below error.
The reason being the SavedQuery component created by the Activity Feeds Solution in source and target environment has the same id. And it is unmanaged component in the target environment and the managed solution that we were trying to import has the same component as managed.
Commenting out all the savedquery from the customizations.xml and importing the solution back solved the issue
Hope it helps.