How to login/logout in flutter pub publish?

Viewed 672

I am trying to publish upgrade for my package and getting error:

Insufficient permissions to upload new versions of package...

I am signed in in Chrome to pub.dev with account that is administrator in publisher for the package.

How can I check what is current account in 'flutter pub', and switch to right account?

3 Answers

This works for me:

pub logout

... and then you can try publishing again:

pub publish

Run flutter pub logout to logout and flutter pub login to login.

To sign out, you need to locate and delete credentials.json from your flutter/.pub-cache. It is hidden, so you need to press Command+Shift+Dot, if do it in Mac Finder.

After you signed out, run 'flutter pub publish' and it will guide you through sign in process.

Related