applies and your error is just another symptom of the order of upgrade.
Can you look in Apps Code for any duplicates, please?
To solve the "sync" problem, use the Un-Match feature against the package followed by a Match Up. When it finds the match, you have a choice to mark it as up-to-date or not.