Flutter发布到pub问题记录
问题1、 Your package is xxx MB. Hosted packages must be smaller than 100 MB. Your .gitignore has no effect since your project does not appear to be in version control.
解决方法:删除repository远程库里的无用文件夹,比如example中的build,fvm文件夹,等。
问题2:Pub needs your authorization to upload packages on your behalf. In a web browser, go to https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force&response_type=code&client_id=818368855108-8grd2eg9tj9f38os6f1urbcvsq399u8n.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A62563&scope=openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email Then click "Allow access".
解决办法:认证需要翻墙,打开google认证页面点击认证。
问题3:Waiting for your authorization... Authorization received, processing...
卡了很久...
解决办法:先执行
export http_proxy=http://127.0.0.1:1087;
export https_proxy=http://127.0.0.1:1087;
在执行上传命令
flutter packages pub publish --server=https://pub.dartlang.org
Flutter项目创建可以参考:https://www.jianshu.com/p/292b0c37e2b1