现在flutter的生态还不够完善,做flutter开发少不了要和native打交道
之前一直都是用的别人的插件,在pubspec.yaml中引用一下
-------
最近自己pub.dev中发布了一下自己的插件,发现整个过程其实挺坑的,最坑的是上传的过程,因为网络的原因,波折了一下,记录一下
--------
刚开始总是遇到
Authorization received, processing...
It looks like accounts.google.com is having some trouble.
Pub will wait for a while before trying to connect again.
下面开始解决
首先配好ss
其次在命令行
export http_proxy=http://127.0.0.1:1087;export https_proxy=http://127.0.0.1:1087;
上面这段在mac版本的ss中有“复制终端代理命令”这个选项,但是注意这个命令只在当前命令行生效,所以不要在别的终端配置,然后在ide中执行upload,这样是没用的
Looks great! Are you ready to upload your package (y/n)? y
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%3A49786&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email
Then click "Allow access".
扫描二维码关注公众号,回复:
9819892 查看本文章
Waiting for your authorization...
Authorization received, processing...
Successfully authorized.
Uploading...
Successfully uploaded package.
终于成功,注意整个过程的要点就是要配置终端代理(同时注意终端代理是全局性的还是只在当前命令行窗口)