Flutter – Token error on publishing package update

Issue

I’m trying to update my package on pub.dev, I suddenly start getting this message which i didnt get before

https://pub.flutter-io.cn package repository requested authentication! You can provide credential using:
    pub token add https://pub.flutter-io.cn

I tried running :

dart pub token add https://pub.flutter-io.cn

which will be successful. But if i try running the publish command again

dart pub publish  

I get :

Invalid token for https://pub.flutter-io.cn deleted.
https://pub.flutter-io.cn package repository requested authentication! You can provide credential using:
    pub token add https://pub.flutter-io.cn

I’m actually stuck here.

NB: My package repo is public and I’ve also added it(as token) but didn’t work. What am I missing?

Solution

that because of https://pub.flutter-io.cn,
so upload to https://pub.dartlang.org


 dart pub publish --server=https://pub.dartlang.org

https://pub.flutter-io.cn URI, I think for china so check your pc where from coming.


see this answer


Answered By – tabarek

Answer Checked By – Clifford M. (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *