发布包时出错:pub已完成,退出代码为1



flutter软件包pub-publish--dry-run>看起来你的帖子大部分都是代码;请添加更多详细信息。看起来你的帖子大部分都是代码;请添加更多详细信息。

Publishing scrollview_manager 1.0.0+1 to https://pub.flutter-io.cn: 
|-- .gitignore
|-- .metadata
|-- CHANGELOG.md
|-- LICENSE
|-- README.md
|-- example
|   |-- .gitignore
|   |-- .metadata
|   |-- README.md
|   |-- android
|   |   |-- .gitignore
|   |   |-- app
|   |   |   |-- build.gradle
|   |   |   '-- src
|   |   |       |-- debug
|   |   |       |   '-- AndroidManifest.xml
|   |   |       |-- main
|   |   |       |   |-- AndroidManifest.xml
|   |   |       |   |-- kotlin
|   |   |       |   |   '-- com
|   |   |       |   |       '-- example
|   |   |       |   |           '-- example
|   |   |       |   |               '-- MainActivity.kt
|   |   |       |   '-- res
|   |   |       |       |-- drawable
|   |   |       |       |   '-- launch_background.xml
|   |   |       |       |-- drawable-v21
|   |   |       |       |   '-- launch_background.xml
|   |   |       |       |-- mipmap-hdpi
|   |   |       |       |   '-- ic_launcher.png
|   |   |       |       |-- mipmap-mdpi
|   |   |       |       |   '-- ic_launcher.png
|   |   |       |       |-- mipmap-xhdpi
|   |   |       |       |   '-- ic_launcher.png
|   |   |       |       |-- mipmap-xxhdpi
|   |   |       |       |   '-- ic_launcher.png
|   |   |       |       |-- mipmap-xxxhdpi
|   |   |       |       |   '-- ic_launcher.png
|   |   |       |       |-- values
|   |   |       |       |   '-- styles.xml
|   |   |       |       '-- values-night
|   |   |       |           '-- styles.xml
|   |   |       '-- profile
|   |   |           '-- AndroidManifest.xml
|   |   |-- build.gradle
|   |   |-- gradle
|   |   |   '-- wrapper
|   |   |       '-- gradle-wrapper.properties
|   |   |-- gradle.properties
|   |   '-- settings.gradle
|   |-- assets
|   |   '-- demo.gif
|   |-- ios
|   |   |-- .gitignore
|   |   |-- Flutter
|   |   |   |-- AppFrameworkInfo.plist
|   |   |   |-- Debug.xcconfig
|   |   |   '-- Release.xcconfig
|   |   |-- Runner
|   |   |   |-- AppDelegate.swift
|   |   |   |-- Assets.xcassets
|   |   |   |   |-- AppIcon.appiconset
|   |   |   |   |   |-- Contents.json
|   |   |   |   |   |-- Icon-App-1024x1024@1x.png
|   |   |   |   |   |-- Icon-App-20x20@1x.png
|   |   |   |   |   | (10 more...)
|   |   |   |   |   |-- Icon-App-76x76@1x.png
|   |   |   |   |   |-- Icon-App-76x76@2x.png
|   |   |   |   |   '-- Icon-App-83.5x83.5@2x.png
|   |   |   |   '-- LaunchImage.imageset
|   |   |   |       |-- Contents.json
|   |   |   |       |-- LaunchImage.png
|   |   |   |       |-- LaunchImage@2x.png
|   |   |   |       |-- LaunchImage@3x.png
|   |   |   |       '-- README.md
|   |   |   |-- Base.lproj
|   |   |   |   |-- LaunchScreen.storyboard
|   |   |   |   '-- Main.storyboard
|   |   |   |-- Info.plist
|   |   |   '-- Runner-Bridging-Header.h
|   |   |-- Runner.xcodeproj
|   |   |   |-- project.pbxproj
|   |   |   |-- project.xcworkspace
|   |   |   |   |-- contents.xcworkspacedata
|   |   |   |   '-- xcshareddata
|   |   |   |       |-- IDEWorkspaceChecks.plist
|   |   |   |       '-- WorkspaceSettings.xcsettings
|   |   |   '-- xcshareddata
|   |   |       '-- xcschemes
|   |   |           '-- Runner.xcscheme
|   |   '-- Runner.xcworkspace
|   |       |-- contents.xcworkspacedata
|   |       '-- xcshareddata
|   |           |-- IDEWorkspaceChecks.plist
|   |           '-- WorkspaceSettings.xcsettings
|   |-- lib
|   |   |-- main.dart
|   |   '-- scrollview_manager_demo.dart
|   |-- pubspec.yaml
|   |-- test
|   |   '-- widget_test.dart
|   '-- web
|       |-- favicon.png
|       |-- icons
|       |   |-- Icon-192.png
|       |   '-- Icon-512.png
|       |-- index.html
|       '-- manifest.json
|-- lib
|   |-- scrollview_manager
|   |   '-- scrollview_manager.dart
|   |-- scrollview_manager.dart
|   '-- utils
|       '-- layout_callback_builder.dart
|-- pubspec.yaml
'-- test
'-- widget_test.dart

Package has 0 warnings.

flutter软件包pub-publish-v>看起来你的帖子大部分都是代码;请添加更多详细信息。看起来你的帖子大部分都是代码;请添加更多详细信息。

Do you want to publish scrollview_manager 1.0.0+1 (y/N)? FINE: Showing confirm message:
| Do you want to publish scrollview_manager 1.0.0+1
y
FINE: Loading OAuth2 credentials.
FINE: Saving OAuth2 credentials.
IO  : Writing 1376 characters to text file C:UserswuchaochaoAppDataRoamingPubCachecredentials.json.
MSG : Uploading...
IO  : HTTP GET https://pub.flutter-io.cn/api/packages/versions/new
| Accept: application/vnd.pub.v2+json
| authorization: <censored>
| user-agent: Dart pub 2.12.1
IO  : HTTP response 200 OK for GET https://pub.flutter-io.cn/api/packages/versions/new
| took 0:00:00.481861
| connection: keep-alive
| cache-control:
| date: Sat, 08 May 2021 06:46:47 GMT
| content-encoding: gzip
| vary: Accept-Encoding,Accept-Encoding
| ali-swift-global-savetime: 1620456407
| strict-transport-security: max-age=5184000,max-age=31536000; preload
| content-type: application/json; charset="utf-8"
| x-xss-protection: 1; mode=block
| x-swift-cachetime: 1800
| server: Tengine
| timing-allow-origin: *
| alt-svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
| content-length: 927
| x-swift-savetime: Sat, 08 May 2021 06:46:47 GMT
| x-frame-options: SAMEORIGIN
| via: 1.1 google, cache57.l2cn2602[363,200-0,M], cache15.l2cn2602[365,0], cache20.cn2160[377,377,200-0,M], cache17.cn2160[380,0]
| x-content-type-options: nosniff
| x-cache: MISS TCP_REFRESH_MISS dirn:13:106728393
| eagleid: 7518032516204564075686314e
IO  : HTTP POST https://storage.flutter-io.cn
| authorization: <censored>
| content-type: multipart/form-data; boundary=dart-http-boundary-3kTzI0I-2OqrGR-0fptqP9tInLQ_YQlMqJ3ct1+vjB.ZXH-X4J1
| user-agent: Dart pub 2.12.1
IO  : HTTP response 404 Not Found for POST https://storage.flutter-io.cn
| took 0:00:09.666582
| connection: keep-alive
| set-cookie: __cfduid=d395f6132b51edbb7c87e9c9048b59ad81620456408; expires=Mon, 07-Jun-21 06:46:48 GMT; path=/; domain=.storage.flutter-io.cn; HttpOnly; SameSite=Lax
| access-control-allow-origin: *
| date: Sat, 08 May 2021 06:46:57 GMT
| cf-request-id: 09ec539cee0000194f3c083000000001
| x-reqid: TQYAAADs3GmGBH0W
| access-control-expose-headers: X-Log, X-Reqid
| cf-cache-status: DYNAMIC
| expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
| content-type: application/json
| access-control-max-age: 2592000
| server: cloudflare
| x-log: X-Log
| content-length: 30
| cf-ray: 64c0bba7c91a194f-HKG
| x-bill: Tbl:flutter-mirrors
FINE: Uploading finished (10.162s).
FINE: Saving OAuth2 credentials.
IO  : Writing 1376 characters to text file C:UserswuchaochaoAppDataRoamingPubCachecredentials.json.
ERR : Failed to upload the package.
FINE: Exception type: ApplicationException
FINE: package:pub/src/utils.dart 512:5                                                      fail
| package:pub/src/command/lish.dart 109:9                                               LishCommand._publish
| ===== asynchronous gap ===========================
| dart:async                                                                            Future.catchError
| package:pub/src/utils.dart 113:52                                                     captureErrors.wrappedCallback
| package:stack_trace                                                                   Chain.capture
| package:pub/src/utils.dart 126:11                                                     captureErrors
| package:pub/src/command.dart 164:13                                                   PubCommand.run
| package:args/command_runner.dart 196:27                                               CommandRunner.runCommand
| package:pub/src/command_runner.dart 150:26                                            PubCommandRunner.runCommand
| package:pub/src/command_runner.dart 138:18                                            PubCommandRunner.run
| C:bswircachebuildersrcthird_partydartthird_partypkgpubbinpub.dart 9:48  main
[+33016 ms] "flutter pub" took 33,210ms.
[   +9 ms] pub finished with exit code 1
[   +2 ms]
#0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1      _DefaultPub.interactively (package:flutter_tools/src/dart/pub.dart:364:7)
<asynchronous suspension>
#2      PackagesPassthroughCommand.runCommand (package:flutter_tools/src/commands/packages.dart:264:5)
<asynchronous suspension>
#3      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1157:12)
<asynchronous suspension>
#4      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1009:27)
<asynchronous suspension>
#5      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#6      AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#7      CommandRunner.runCommand (package:args/command_runner.dart:197:13)
<asynchronous suspension>
#8      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:278:9)
<asynchronous suspension>
#9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#10     AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#11     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:234:5)
<asynchronous suspension>
#12     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:64:9)
<asynchronous suspension>
#13     run.<anonymous closure> (package:flutter_tools/runner.dart:62:12)
<asynchronous suspension>
#14     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#15     AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#16     runInContext (package:flutter_tools/src/context_runner.dart:73:10)
<asynchronous suspension>
#17     main (package:flutter_tools/executable.dart:90:3)
<asynchronous suspension>

[ +264 ms] ensureAnalyticsSent: 252ms
[   +4 ms] Running shutdown hooks
[        ] Shutdown hooks complete
[        ] exiting with code 1

发布插件包时出错。如何解决?

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

您不能将项目发布到主机https://pub.flutter-io.cn或其他主机,必须是到主机https://pub.dartlang.org。您需要删除您的env导出PUB_HOSTED_URL和FLUTTER_STORAGE_BASE_URL。这对我来说是工作,希望对我有帮助。

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

最新更新