flutter插件发布及问题解决

flutter插件发布及问题解决

1,执行 flutter pub publish--dry-run 检查是否具备发布条件

遇到的问题1:

It‘s strongly recommended to include a “homepage“ or “repository“ field

解决方案:在 pubspec.yaml 中配置 主页 homepage 地址 :

homepage: https://github.com/catmaomao/channel_test

可参考:https://blog.csdn.net/shulianghan/article/details/120024180

2,执行 flutter pub publish--server=https://pub.dartlang.org 发布

如果执行flutter pub publish发布的话会遇到以下错误,国内还是用 flutter pub publish--server=https://pub.dartlang.org 来发布

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

问题1:It looks like accounts.google.com is having some trouble. Pub will wait for a while before trying to connect again. OS Error: Operation timed out, errno = 60, address = accounts.google.com, port = 53481 pub finished with exit code 69

原因:

1、国内墙;

2、flutter环境配置添加了国内镜像

解决方式:

1、翻墙;

2、屏蔽环境变量里关于flutter的国内镜像;

屏蔽方式如下:

# export PUB_HOSTED_URL=https://pub.flutter-io.cn

# export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

3、设置终端代理命令(这个是我解决的方式),这个非常重要,不然就会报上面超时错误了

如果出现:Flutter pub finished with exit code 1

解决方式:flutter packages pub publish --server=https://pub.dartlang.org

此问题原文


比丘资源网 » flutter插件发布及问题解决

发表回复

提供最优质的资源集合

立即查看 了解详情