【错误记录】发布 Flutter 插件包报错 ( ‘gmail.com‘ has insufficient permissions to upload new versions of package)

2023-03-29 16:18:29 浏览数 (1)

文章目录

  • 一、报错信息
  • 二、解决方案

一、报错信息


推送 Flutter 包到中央仓库 , 第一次推送报错 ,

代码语言:javascript复制
D:02_Project02_Android_Learnflutter_package>flutter packages pub publish --server=https://pub.dartlang.org
Publishing flutter_package 0.0.1 to https://pub.dartlang.org:
|-- .gitignore
|-- .metadata
|-- CHANGELOG.md
|-- LICENSE
|-- README.md
|-- lib
|   '-- flutter_package.dart
|-- pubspec.yaml
'-- test
    '-- flutter_package_test.dart

Publishing is forever; packages cannot be unpublished.
Policy details are available at https://pub.dev/policy

Do you want to publish flutter_package 0.0.1 (y/N)? y
Uploading...
Version 0.0.1 of package flutter_package already exists.
pub finished with exit code 1

好 , 版本号已经存在 , 这里修改下版本号再次推送 ,

代码语言:javascript复制
D:02_Project02_Android_Learnflutter_package>flutter packages pub publish --server=https://pub.dartlang.org
Publishing flutter_package 0.0.3 to https://pub.dartlang.org:
|-- .gitignore
|-- .metadata
|-- CHANGELOG.md
|-- LICENSE
|-- README.md
|-- lib
|   '-- flutter_package.dart
|-- pubspec.yaml
'-- test
    '-- flutter_package_test.dart
Package validation found the following potential issue:
* .CHANGELOG.md doesn't mention current version (0.0.3).
  Consider updating it with notes on this version prior to publication.
Package validation found the following hint:
* You're about to publish a package that opts into null safety.
  The previous version (0.0.1) isn't opted in.
  See https://dart.dev/null-safety/migration-guide for best practices.

Publishing is forever; packages cannot be unpublished.
Policy details are available at https://pub.dev/policy


Package has 1 warning and 1 hint... Do you want to publish flutter_package 0.0.3 (y/N)? y
Uploading...
`xx@gmail.com` has insufficient permissions to upload new versions of package `flutter_package`.
pub finished with exit code 1

二、解决方案


到 https://pub.dev/packages 搜索一下 , flutter_package 名字已经有人占了 , 有个老兄在 2019 年就使用了该名称 , 上传的是 v0.01 版本 , 因此第一次报错是版本已存在 ;

第二次改了下版本 , 上传时会验证权限 , 不是本人 , 肯定不能覆盖这个版本号 ;

总结一下就是 , Flutter 插件名称被人占了 , 就不能再用了 , 重新取个新名字吧 ;

整了个超长的名字 flutter_package_first_demo , 上传成功 ;

插件地址是 : https://pub.dev/packages/flutter_package_first_demo

0 人点赞