One of my package dependency is hosted on OnePub.
dart pub getI'm seeing a 401: Unauthorized error.
This means that you are not logged in or not logged into the correct organisation.
The first thing to do is to ensure you are logged into the OnePub on the CLI:
dart pub getagain and hopefully that solves your problem.
If that didn't fix it then read on.
You may be a member of multiple OnePub organisations.
If you joined OnePub by accepting an invitation then you will automatically be a member of two OnePub organisations.
When you accept a OnePub invitation we automatically create your own personal OnePub organisation as well as joining you to the organisation you were invited to.
This could mean that when you logged into OnePub from the CLI that you logged into the wrong organisation.
You can check which organisation you are logged into by running:
You should see the Organisation name near the bottom of the output.
To switch between organisations at the CLI run:
When you click on the url displayed by the login command you will be prompted with a droplist showing the organisations that you belong to.
Select the organisation that want to login to.
dart pub get
Now your problem should be solved.