This happened to me several times:
What ultimately decided for me (OS X) removes the pub pub:
sudo rm -Rf /Users/<username>/.pub-cache
Also delete the package directory in the root of the project:
sudo rm -Rf packages
Then pub get back in your project (s), but make sure that you are not working as root (a whoami will tell you and exit will get you out of there).
source share