When attempting to import a solution in Dynamics 365, you encounter the following error:
"The import of solution: [solution name] failed.
Error code 8004f016"
The grid within the error dialog includes a row of Type = System Views. The detail text shown for this row is the following message:
"A managed solution cannot overwrite a SavedQuery component on the target system that has an unmanaged base instance. The most likely scenario for this error is that an unmanaged solution has installed a new unmanaged SavedQuery component on the target system, and now a managed solution from the same publisher is trying to install that same SavedQuery component as managed. This will cause an invalid layering of solutions on the target system and is not allowed"
Download the XML log file and open it in Excel. In the Components tab locate the cell: 0x8004F016
In the next column will be an error message that includes the id of the component:
"A managed solution cannot overwrite the SavedQuery component with Id=[Component Id] which has an unmanaged base instance. The most likely scenario for this error is that an unmanaged solution has installed a new unmanaged SavedQuery component on the target system, and now a managed solution from the same publisher is trying to install that same SavedQuery component as managed. This will cause an invalid layering of solutions on the target system and is not allowed."