【错误记录】发布 Flutter 插件包报错 ( Failed to upload the package.pub finished with exit code 1 )
生活随笔
收集整理的這篇文章主要介紹了
【错误记录】发布 Flutter 插件包报错 ( Failed to upload the package.pub finished with exit code 1 )
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
文章目錄
- 一、報錯信息
- 二、解決方案
一、報錯信息
發(fā)布插件包 , 確認發(fā)布 , 校驗了 Google 賬號 , 之后報錯如下 :
Failed to upload the package. pub finished with exit code 1完整報錯信息 :
D:\002_Project\002_Android_Learn\flutter_package>flutter packages pub publish Publishing flutter_package 0.0.1 to https://pub.flutter-io.cn: |-- .gitignore |-- .metadata |-- CHANGELOG.md |-- LICENSE |-- README.md |-- lib | '-- flutter_package.dart |-- pubspec.yaml '-- test'-- flutter_package_test.dartPublishing is forever; packages cannot be unpublished. Policy details are available at https://pub.dev/policyDo you want to publish flutter_package 0.0.1 (y/N)? y Uploading... Failed to upload the package. pub finished with exit code 1使用
flutter packages pub publish -v命令 , 執(zhí)行后 , 會打印出更加詳細的日志信息 ;
詳細報錯信息 :
FINE: Uploading finished (0.642s). FINE: Saving OAuth2 credentials. IO : Writing 1381 characters to text file D:\001_Develop\010_Flutter\flutter_windows_2.2.3-stable\flutter\.pub-cache\credentials.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:\b\s\w\ir\cache\builder\src\third_party\dart\third_party\pkg\pub\bin\pub.dart 9:48 main [+11046 ms] "flutter pub" took 11,127ms. [ +4 ms] pub finished with exit code 1 [ +1 ms] #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)#1 _DefaultPub.interactively (package:flutter_tools/src/dart/pub.dart:368:7)<asynchronous suspension><asynchronous suspension>#3 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1043:27)<asynchronous suspension>#4 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)<asynchronous suspension>#5 CommandRunner.runCommand (package:args/command_runner.dart:196:13)<asynchronous suspension>#6 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:284:9)<asynchronous suspension>#7 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)<asynchronous suspension>#8 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:232:5)<asynchronous suspension>#9 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)<asynchronous suspension>#10 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)<asynchronous suspension>#11 main (package:flutter_tools/executable.dart:91:3)<asynchronous suspension>[ +258 ms] ensureAnalyticsSent: 257ms [ +3 ms] Running shutdown hooks [ ] Shutdown hooks complete [ ] exiting with code 1D:\002_Project\002_Android_Learn\flutter_package>二、解決方案
由于設置了 Flutter 鏡像導致 ;
PUB_HOSTED_URL : https://pub.flutter-io.cn
FLUTTER_STORAGE_BASE_URL : https://storage.flutter-io.cn
從環(huán)境變量中移除上述兩個鏡像 ;
再使用如下命令 , 向 Flutter 中央倉庫推送 Dart 包 ;
flutter packages pub publish --server=https://pub.dartlang.org終于上傳成功了 :
D:\002_Project\002_Android_Learn\flutter_package>flutter packages pub publish --server=https://pub.dartlang.org Publishing flutter_package_first_demo 0.0.1 to https://pub.dartlang.org: |-- .gitignore |-- .metadata |-- CHANGELOG.md |-- LICENSE |-- README.md |-- lib | '-- flutter_package_first_demo.dart |-- pubspec.yaml '-- test'-- flutter_package_test.dartPublishing is forever; packages cannot be unpublished. Policy details are available at https://pub.dev/policyDo you want to publish flutter_package_first_demo 0.0.1 (y/N)? y Uploading... Successfully uploaded package.D:\002_Project\002_Android_Learn\flutter_package>總結
以上是生活随笔為你收集整理的【错误记录】发布 Flutter 插件包报错 ( Failed to upload the package.pub finished with exit code 1 )的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【错误记录】发布 Flutter 插件包
- 下一篇: 【错误记录】发布 Flutter 插件包