美文网首页
flutter pub 发布过程记录

flutter pub 发布过程记录

作者: 李小轰 | 来源:发表于2021-07-02 15:43 被阅读0次
    flutter package 发布到 pub.dev 过程记录:

    前置条件

    1. package 代码要上传到 github
    2. 要有google gmail 邮箱

    满足以上条件就可以去发布了,发布前需要完善pubspec.yaml信息:


    pubspec.png
    author:  昵称 <XXXXX@gmail.com>
    # homepage githup项目地址
    homepage:  https://github.com/XXX/flutter_subscreen_plugin 
    

    接下来,提交,命令行执行:

    $ flutter packages pub publish --server=https://pub.dartlang.org
    
    image.png

    选择 y,点击链接到Google进行验证。


    image.png

    出现报错:

    It looks like accounts.google.com is having some trouble.
    

    网络翻墙原因造成,我们在命令行输入以下语句:

    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 
    

    终端发出报错信息:


    image.png

    LICENSE文件不能为空,我们进行补充,如下:

    Copyright © 2021, llixiaohong
    All rights reserved.
    
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions are met:
    
    Redistributions of source code must retain the above copyright notice, this
    list of conditions and the following disclaimer.
    
    Redistributions in binary form must reproduce the above copyright notice,
    this list of conditions and the following disclaimer in the documentation
    and/or other materials provided with the distribution.
    
    Neither the name of the copyright holder nor the names of its
    contributors may be used to endorse or promote products derived from
    this software without specific prior written permission.
    
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    

    补充完毕,重走一遍流程命令,如下所示就是成功上传,等待那边服务器重新更新之后(1个小时左右)就可以使用了


    提交结果.png

    发布到pub上面的地址是什么呢:

    #https://pub.flutter-io.cn/packages/插件名,示例
    https://pub.flutter-io.cn/packages/flutter_subscreen_plugin
    

    如果你后面维护需要升级版本号,重复上面发布的操作,就可以了。

    相关文章

      网友评论

          本文标题:flutter pub 发布过程记录

          本文链接:https://www.haomeiwen.com/subject/awoeultx.html