美文网首页
2023-01-11 dart pub publish Conn

2023-01-11 dart pub publish Conn

作者: 我是小胡胡分胡 | 来源:发表于2023-01-10 17:45 被阅读0次

    dart pub publish --server=http://localhost:8080

        |-- stub_server.dart
        '-- utils.dart
    Connection closed before full header was received
    
    
    

    解决方法:
    fanqiang

        '-- utils.dart
    Package validation found the following potential issue:
    * ./CHANGELOG.md doesn't mention current version (0.13.19).
      Consider updating it with notes on this version prior to publication.
    
    Publishing is forever; packages cannot be unpublished.
    Policy details are available at https://pub.dev/policy
    
    
    Package has 1 warning.. Do you want to publish httptest 0.13.19 (y/N)? y
    Uploading... 
    Successfully uploaded package.
    

    google邮箱验证存储到哪里了。
    第一次需要验证。之后publish 就不需要了。

    删除.pub-cache

     rm -rf ~/.pub-cache/
    

    很好,出现google验证权限链接了:

    Package has 1 warning.. Do you want to publish httptest 0.13.20 (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%3A51112&code_challenge=EkS34GtmlP9hfFChPdu2J_szCHTz-yrr3Jf6O_k3DO4&code_challenge_method=S256&scope=openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email
    Then click "Allow access".
    
    Waiting for your authorization...
    

    验证以后:终端流程自动继续:

    Waiting for your authorization...
    Authorization received, processing...
    Successfully authorized.
    Uploading... 
    Successfully uploaded package.
    

    可以看到,多了一个文件:

    /Users/xx/.pub-cache/credentials.json

    credentials.json
    具体内容如下:

    {
        "accessToken": "ya29.a0AX9GBdV649NEHe13AQ5UraYMxc删除。。。",
        "refreshToken": "1//0gmoGkicxBSKtCgYIARAAGBASNwF-L9I删除。。。",
        "idToken": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImEyOWFiYzE5YmUyN2删除。。。",
        "tokenEndpoint": "https://accounts.google.com/o/oauth2/token",
        "scopes":
        [
            "openid",
            "https://www.googleapis.com/auth/userinfo.email"
        ],
        "expiration": 1673434249641
    }
    

    就是这个文件存储了publish登录身份。

    以上是flutter 2.5.3 ( dart 2.14.4)版本。

    flutter3.3.7 dart 2.18.4

    删除两个缓存文件夹。

    rm -rf ~/.pub-cache/
    rm -rm $FLUTTER_ROOT/bin/cache
    

    还是能直接publish

      '-- utils.dart
    Downloading http_parser 4.0.2...
    Downloading string_scanner 1.2.0...
    Downloading collection 1.17.0...
    Downloading path 1.8.3...
    Downloading source_span 1.9.1...
    Downloading async 2.10.0...
    Package validation found the following potential issue:
    * ./CHANGELOG.md doesn't mention current version (0.13.23).
      Consider updating it with notes on this version prior to publication.
    
    Publishing is forever; packages cannot be unpublished.
    Policy details are available at https://pub.dev/policy
    
    
    Package has 1 warning.. Do you want to publish httptest 0.13.23 to https://pub.dartlang.org (y/N)? y
    Uploading... (7.1s)
    Successfully uploaded https://pub.dev/packages/httptest version 0.13.23.
    a58@huchudeMacBook-Pro http % dart --version
    Dart SDK version: 2.18.4 (stable) (Tue Nov 1 15:15:07 2022 +0000) on "macos_arm64"
    
    

    flutter 3.0.0之后:
    https://github.com/dart-lang/pub

    pub


    image.png

    打个断点:


    image.png image.png

    原来是放到

    /Users/xx/Library/Application Support/dart
    

    这个目录下面了。

    相关文章

      网友评论

          本文标题:2023-01-11 dart pub publish Conn

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