Flutter 创建导致错误 尝试在 https://pub.dartlang.org 找到包 cupertino_icons 时出现 TLS 错误

Posted

技术标签:

【中文标题】Flutter 创建导致错误 尝试在 https://pub.dartlang.org 找到包 cupertino_icons 时出现 TLS 错误【英文标题】:Flutter create results in error Got TLS error trying to find package cupertino_icons at https://pub.dartlang.org 【发布时间】:2020-06-10 10:55:54 【问题描述】:

当我尝试使用 flutter create 在命令行中创建一个新的颤振项目时,我收到错误: 尝试在 https://pub.dartlang.org 查找包 cupertino_icons 时遇到 TLS 错误

android Studio 中创建颤振项目也会卡住,没有任何错误消息。

我在 Windows 10 上,我在 C 盘上有 Flutter SDK,并且我在机器上也有完全的管理员权限。这是在新机器上全新安装的 Flutter。

我尝试以管理员身份同时运行 Android Studio 和命令行,但没有帮助。

这是颤振医生 -v 的输出:

[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.657], locale en-US)
    • Flutter version 1.12.13+hotfix.8 at C:\src\flutter
    • Framework revision 0b8abb4724 (2 weeks ago), 2020-02-11 11:44:36 -0800
    • Engine revision e1e6ced81d
    • Dart version 2.7.0


[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at C:\Users\myuser\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
    • All Android licenses accepted.

[√] Android Studio (version 3.6)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 43.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[!] Connected device
    ! No devices available

! Doctor found issues in 1 category.

这是flutter create app -v的一些输出:

[  +10 ms] executing: [C:\src\flutter\] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +228 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +1 ms] 0b8abb4724aa590dd0f429683339b1e045a1594d
[        ] executing: [C:\src\flutter\] git describe --match v*.*.* --first-parent --long --tags
[ +213 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[        ] v1.12.13+hotfix.8-0-g0b8abb472
[   +5 ms] executing: [C:\src\flutter\] git rev-parse --abbrev-ref --symbolic @u
[ +211 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @u
[   +1 ms] origin/stable
[        ] executing: [C:\src\flutter\] git ls-remote --get-url origin
[ +211 ms] Exit code 0 from: git ls-remote --get-url origin
[   +1 ms] https://github.com/flutter/flutter.git
[ +240 ms] executing: [C:\src\flutter\] git rev-parse --abbrev-ref HEAD
[ +233 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[  +69 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'iosEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +2 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +25 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[   +8 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +4 ms] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +2 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[   +3 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +26 ms] Creating project mytestapp... androidx: true
[  +24 ms]   mytestapp\.gitignore (created)
[  +10 ms]   mytestapp\.idea\libraries\Dart_SDK.xml (created)
[   +6 ms]   mytestapp\.idea\libraries\Flutter_for_Android.xml (created)
[   +2 ms]   mytestapp\.idea\libraries\KotlinJavaRuntime.xml (created)
[   +4 ms]   mytestapp\.idea\modules.xml (created)
[   +3 ms]   mytestapp\.idea\runConfigurations\main_dart.xml (created)
[   +3 ms]   mytestapp\.idea\workspace.xml (created)
[   +3 ms]   mytestapp\.metadata (created)
[   +2 ms]   mytestapp\android\app\build.gradle (created)
[   +5 ms]   mytestapp\android\app\src\main\kotlin\com\example\mytestapp\MainActivity.kt (created)
[  +25 ms]   mytestapp\android\build.gradle (created)
[   +9 ms]   mytestapp\android\mytestapp_android.iml (created)
[   +1 ms]   mytestapp\android\.gitignore (created)
[   +3 ms]   mytestapp\android\app\src\debug\AndroidManifest.xml (created)
[   +1 ms]   mytestapp\android\app\src\main\AndroidManifest.xml (created)
[   +2 ms]   mytestapp\android\app\src\main\res\drawable\launch_background.xml (created)
[   +5 ms]   mytestapp\android\app\src\main\res\mipmap-hdpi\ic_launcher.png (created)
[   +4 ms]   mytestapp\android\app\src\main\res\mipmap-mdpi\ic_launcher.png (created)
[   +5 ms]   mytestapp\android\app\src\main\res\mipmap-xhdpi\ic_launcher.png (created)
[   +4 ms]   mytestapp\android\app\src\main\res\mipmap-xxhdpi\ic_launcher.png (created)
[   +5 ms]   mytestapp\android\app\src\main\res\mipmap-xxxhdpi\ic_launcher.png (created)
[   +4 ms]   mytestapp\android\app\src\main\res\values\styles.xml (created)
[   +4 ms]   mytestapp\android\app\src\profile\AndroidManifest.xml (created)
[   +4 ms]   mytestapp\android\gradle\wrapper\gradle-wrapper.properties (created)
[   +5 ms]   mytestapp\android\gradle.properties (created)
[   +2 ms]   mytestapp\android\settings.gradle (created)
[   +5 ms]   mytestapp\ios\Runner\AppDelegate.swift (created)
[   +5 ms]   mytestapp\ios\Runner\Runner-Bridging-Header.h (created)
[   +4 ms]   mytestapp\ios\Runner.xcodeproj\project.pbxproj (created)
[   +8 ms]   mytestapp\ios\Runner.xcodeproj\xcshareddata\xcschemes\Runner.xcscheme (created)
[   +6 ms]   mytestapp\ios\.gitignore (created)
[   +5 ms]   mytestapp\ios\Flutter\AppFrameworkInfo.plist (created)
[   +6 ms]   mytestapp\ios\Flutter\Debug.xcconfig (created)
[   +5 ms]   mytestapp\ios\Flutter\Release.xcconfig (created)
[   +5 ms]   mytestapp\ios\Runner\Assets.xcassets\AppIcon.appiconset\Contents.json (created)
[   +5 ms]   mytestapp\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-1024x1024@1x.png (created)
[   +5 ms]   mytestapp\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-20x20@1x.png (created)
[   +4 ms]   mytestapp\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-20x20@2x.png (created)
[   +5 ms]   mytestapp\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-20x20@3x.png (created)
[   +4 ms]   mytestapp\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-29x29@1x.png (created)
[   +5 ms]   mytestapp\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-29x29@2x.png (created)
[   +5 ms]   mytestapp\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-29x29@3x.png (created)
[   +7 ms]   mytestapp\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-40x40@1x.png (created)
[   +5 ms]   mytestapp\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-40x40@2x.png (created)
[   +6 ms]   mytestapp\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-40x40@3x.png (created)
[   +4 ms]   mytestapp\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-60x60@2x.png (created)
[   +5 ms]   mytestapp\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-60x60@3x.png (created)
[   +6 ms]   mytestapp\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-76x76@1x.png (created)
[   +5 ms]   mytestapp\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-76x76@2x.png (created)
[   +4 ms]   mytestapp\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-83.5x83.5@2x.png (created)
[   +6 ms]   mytestapp\ios\Runner\Assets.xcassets\LaunchImage.imageset\Contents.json (created)
[   +5 ms]   mytestapp\ios\Runner\Assets.xcassets\LaunchImage.imageset\LaunchImage.png (created)
[   +5 ms]   mytestapp\ios\Runner\Assets.xcassets\LaunchImage.imageset\LaunchImage@2x.png (created)
[   +6 ms]   mytestapp\ios\Runner\Assets.xcassets\LaunchImage.imageset\LaunchImage@3x.png (created)
[   +6 ms]   mytestapp\ios\Runner\Assets.xcassets\LaunchImage.imageset\README.md (created)
[   +5 ms]   mytestapp\ios\Runner\Base.lproj\LaunchScreen.storyboard (created)
[   +5 ms]   mytestapp\ios\Runner\Base.lproj\Main.storyboard (created)
[   +5 ms]   mytestapp\ios\Runner\Info.plist (created)
[   +2 ms]   mytestapp\ios\Runner.xcodeproj\project.xcworkspace\contents.xcworkspacedata (created)
[   +5 ms]   mytestapp\ios\Runner.xcodeproj\xcshareddata\xcschemes\Runner.xcscheme (existing - skipped)
[        ]   mytestapp\ios\Runner.xcworkspace\contents.xcworkspacedata (created)
[   +4 ms]   mytestapp\lib\main.dart (created)
[   +4 ms]   mytestapp\mytestapp.iml (created)
[   +2 ms]   mytestapp\pubspec.yaml (created)
[   +3 ms]   mytestapp\README.md (created)
[   +5 ms]   mytestapp\test\widget_test.dart (created)
[  +33 ms] Running "flutter pub get" in mytestapp...
[   +3 ms] Using C:\src\flutter\.pub-cache for the pub cache.
[   +2 ms] executing: [c:\flutter_projects\mytestapp\] C:\src\flutter\bin\cache\dart-sdk\bin\pub.bat --verbose get
--no-precompile
[ +449 ms] FINE: Pub 2.7.0
[   +2 ms] IO  : Spawning "cmd /c ver" in c:\flutter_projects\mytestapp\.
[  +51 ms] IO  : Finished ver. Exit code 0.
[   +1 ms]     | stdout:
[        ]     | |
[        ]     | | Microsoft Windows [Version 10.0.18363.657]
[        ]     | Nothing output on stderr.
[  +34 ms] MSG : Resolving dependencies...
[   +7 ms] SLVR: fact: mytestapp is 1.0.0+1
[   +2 ms] SLVR: derived: mytestapp
[  +17 ms] SLVR: fact: mytestapp depends on flutter any from sdk
[   +6 ms] SLVR: fact: mytestapp depends on cupertino_icons ^0.1.2
[   +1 ms] SLVR: fact: mytestapp depends on flutter_test any from sdk
[   +1 ms] SLVR:   selecting mytestapp
[   +2 ms] SLVR:   derived: flutter_test any from sdk
[   +4 ms] SLVR:   derived: cupertino_icons ^0.1.2
[        ] SLVR:   derived: flutter any from sdk
[   +2 ms] IO  : Get versions from https://pub.dartlang.org/api/packages/cupertino_icons.
[  +13 ms] IO  : HTTP GET https://pub.dartlang.org/api/packages/cupertino_icons
[        ]     | Accept: application/vnd.pub.v2+json
[   +6 ms]     | X-Pub-OS: windows
[        ]     | X-Pub-Command: get
[   +3 ms]     | X-Pub-Session-ID: 12B32BE8-FB1F-481E-B6B4-8A8C643EEF43
[   +1 ms]     | X-Pub-Environment: flutter_cli:create
[   +1 ms]     | X-Pub-Reason: direct
[   +2 ms]     | user-agent: Dart pub 2.7.0
[ +475 ms] IO  : HTTP error:
[   +2 ms]     | HandshakeException: Handshake error in client (OS Error:
[        ]     |        CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(handshake.cc:354))
[        ]     |
[   +1 ms]     | dart:_http                                         _HttpClient.openUrl
[        ]     | package:http/src/io_client.dart 33:36              IOClient.send
[        ]     | package:pub/src/http.dart 68:39                    _PubHttpClient.send
[        ]     | package:http_retry/http_retry.dart 97:33           RetryClient.send
[        ]     | package:pub/src/http.dart 194:43                   _ThrowingClient.send
[        ]     | package:http_throttle/http_throttle.dart 33:31     ThrottleClient.send
[   +2 ms]     | ===== asynchronous gap ===========================
[        ]     | dart:async                                         _asyncThenWrapperHelper
[   +2 ms]     | package:http_throttle/http_throttle.dart           ThrottleClient.send
[        ]     | package:http/src/base_client.dart 169:38           BaseClient._sendUnstreamed
[        ]     | package:http/src/base_client.dart 32:7             BaseClient.get
[        ]     | package:http/src/base_client.dart 117:12           BaseClient.read
[        ]     | package:pub/src/source/hosted.dart 160:31          BoundHostedSource.doGetVersions
[        ]     | package:pub/src/source.dart 167:12                 BoundSource.getVersions
[        ]     | package:pub/src/solver/package_lister.dart 76:44   PackageLister._versions.<fn>.<fn>
[   +1 ms]     | dart:async                                         runZoned
[        ]     | package:pub/src/http.dart 272:10                   withDependencyType
[   +2 ms]     | package:pub/src/solver/package_lister.dart 75:33   PackageLister._versions.<fn>
[        ]     | dart:async                                         new Future.sync
[   +4 ms]     | package:async/src/async_memoizer.dart 43:42        AsyncMemoizer.runOnce
[        ]     | package:pub/src/solver/package_lister.dart 74:58   PackageLister._versions
[        ]     | package:pub/src/solver/package_lister.dart 111:21  PackageLister.countVersions
[        ]     | package:pub/src/solver/version_solver.dart 354:44  VersionSolver._choosePackageVersion.<fn>
[        ]     | package:pub/src/utils.dart 301:39                  minByAsync
[   +2 ms]     | ===== asynchronous gap ===========================
[   +3 ms]     | dart:async                                         _asyncThenWrapperHelper
[        ]     | package:pub/src/utils.dart                         minByAsync
[        ]     | package:pub/src/solver/version_solver.dart 350:25  VersionSolver._choosePackageVersion
[        ]     | package:pub/src/solver/version_solver.dart 97:22   VersionSolver.solve
[        ]     | ===== asynchronous gap ===========================
[        ]     | dart:async                                         _asyncThenWrapperHelper
[        ]     | package:pub/src/solver/version_solver.dart         VersionSolver.solve
[        ]     | package:pub/src/solver.dart 35:10                  resolveVersions.<fn>
[   +2 ms]     | package:pub/src/log.dart 378:18                    progress
[   +3 ms]     | package:pub/src/solver.dart 32:10                  resolveVersions
[        ]     | package:pub/src/entrypoint.dart 217:24             Entrypoint.acquireDependencies
[        ]     | package:pub/src/command/get.dart 41:23             GetCommand.run
[        ]     | package:args/command_runner.dart 197:27            CommandRunner.runCommand
[        ]     | package:pub/src/command_runner.dart 171:39         PubCommandRunner.runCommand.<fn>
[        ]     | dart:async                                         new Future.sync
[        ]     | package:pub/src/utils.dart 109:12                  captureErrors.<fn>
[        ]     | package:stack_trace                                Chain.capture
[   +2 ms]     | package:pub/src/utils.dart 122:11                  captureErrors
[   +3 ms]     | package:pub/src/command_runner.dart 171:13         PubCommandRunner.runCommand
[ +644 ms] IO  : Retry #1 for GET https://pub.dartlang.org/api/packages/cupertino_icons...
[   +3 ms] IO  : HTTP GET https://pub.dartlang.org/api/packages/cupertino_icons
[   +2 ms]     | Accept: application/vnd.pub.v2+json
[        ]     | X-Pub-OS: windows
[        ]     | X-Pub-Command: get
[        ]     | X-Pub-Session-ID: 12B32BE8-FB1F-481E-B6B4-8A8C643EEF43
[        ]     | X-Pub-Environment: flutter_cli:create
[        ]     | X-Pub-Reason: direct
[   +1 ms]     | user-agent: Dart pub 2.7.0
[ +249 ms] IO  : HTTP error:
[   +1 ms]     | HandshakeException: Handshake error in client (OS Error:
[        ]     |        CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(handshake.cc:354))
[        ]     |
[        ]     | dart:_http                                         _HttpClient.openUrl
[        ]     | package:http/src/io_client.dart 33:36              IOClient.send
[        ]     | package:pub/src/http.dart 68:39                    _PubHttpClient.send
[        ]     | package:http_retry/http_retry.dart 97:33           RetryClient.send
[        ]     | ===== asynchronous gap ===========================
[        ]     | dart:async                                         _asyncThenWrapperHelper
[        ]     | package:http_retry/http_retry.dart                 RetryClient.send
[        ]     | package:pub/src/http.dart 194:43                   _ThrowingClient.send
[   +2 ms]     | package:http_throttle/http_throttle.dart 33:31     ThrottleClient.send
[        ]     | ===== asynchronous gap ===========================
[   +3 ms]     | dart:async                                         _asyncThenWrapperHelper
[        ]     | package:http_throttle/http_throttle.dart           ThrottleClient.send
[        ]     | package:http/src/base_client.dart 169:38           BaseClient._sendUnstreamed
[        ]     | package:http/src/base_client.dart 32:7             BaseClient.get
[        ]     | package:http/src/base_client.dart 117:12           BaseClient.read
[        ]     | package:pub/src/source/hosted.dart 160:31          BoundHostedSource.doGetVersions
[        ]     | package:pub/src/source.dart 167:12                 BoundSource.getVersions
[        ]     | package:pub/src/solver/package_lister.dart 76:44   PackageLister._versions.<fn>.<fn>
[        ]     | dart:async                                         runZoned
[   +1 ms]     | package:pub/src/http.dart 272:10                   withDependencyType
[   +2 ms]     | package:pub/src/solver/package_lister.dart 75:33   PackageLister._versions.<fn>
[        ]     | dart:async                                         new Future.sync
[        ]     | package:async/src/async_memoizer.dart 43:42        AsyncMemoizer.runOnce
[        ]     | package:pub/src/solver/package_lister.dart 74:58   PackageLister._versions
[        ]     | package:pub/src/solver/package_lister.dart 111:21  PackageLister.countVersions
[        ]     | package:pub/src/solver/version_solver.dart 354:44  VersionSolver._choosePackageVersion.<fn>
[        ]     | package:pub/src/utils.dart 301:39                  minByAsync
[        ]     | ===== asynchronous gap ===========================
[        ]     | dart:async                                         _asyncThenWrapperHelper
[        ]     | package:pub/src/utils.dart                         minByAsync
[   +3 ms]     | package:pub/src/solver/version_solver.dart 350:25  VersionSolver._choosePackageVersion
[   +2 ms]     | package:pub/src/solver/version_solver.dart 97:22   VersionSolver.solve
[        ]     | ===== asynchronous gap ===========================
[        ]     | dart:async                                         _asyncThenWrapperHelper
[        ]     | package:pub/src/solver/version_solver.dart         VersionSolver.solve
[        ]     | package:pub/src/solver.dart 35:10                  resolveVersions.<fn>
[        ]     | package:pub/src/log.dart 378:18                    progress
[        ]     | package:pub/src/solver.dart 32:10                  resolveVersions
[        ]     | package:pub/src/entrypoint.dart 217:24             Entrypoint.acquireDependencies
[        ]     | package:pub/src/command/get.dart 41:23             GetCommand.run
[        ]     | package:args/command_runner.dart 197:27            CommandRunner.runCommand
[        ]     | package:pub/src/command_runner.dart 171:39         PubCommandRunner.runCommand.<fn>
[        ]     | dart:async                                         new Future.sync
[        ]     | package:pub/src/utils.dart 109:12                  captureErrors.<fn>
[   +2 ms]     | package:stack_trace                                Chain.capture
[        ]     | package:pub/src/utils.dart 122:11                  captureErrors
[   +2 ms]     | package:pub/src/command_runner.dart 171:13         PubCommandRunner.runCommand
[ +815 ms] IO  : Retry #2 for GET https://pub.dartlang.org/api/packages/cupertino_icons...
[   +6 ms] IO  : HTTP GET https://pub.dartlang.org/api/packages/cupertino_icons
[   +4 ms]     | Accept: application/vnd.pub.v2+json
[   +6 ms]     | X-Pub-OS: windows
[   +4 ms]     | X-Pub-Command: get
[   +6 ms]     | X-Pub-Session-ID: 12B32BE8-FB1F-481E-B6B4-8A8C643EEF43
[   +3 ms]     | X-Pub-Environment: flutter_cli:create
[   +1 ms]     | X-Pub-Reason: direct
[   +1 ms]     | user-agent: Dart pub 2.7.0
[ +226 ms] IO  : HTTP error:
[   +1 ms]     | HandshakeException: Handshake error in client (OS Error:
[        ]     |        CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(handshake.cc:354))
[        ]     |
[        ]     | dart:_http                                         _HttpClient.openUrl
[        ]     | package:http/src/io_client.dart 33:36              IOClient.send
[        ]     | package:pub/src/http.dart 68:39                    _PubHttpClient.send
[        ]     | package:http_retry/http_retry.dart 97:33           RetryClient.send
[        ]     | ===== asynchronous gap ===========================
[        ]     | dart:async                                         _asyncThenWrapperHelper
[        ]     | package:http_retry/http_retry.dart                 RetryClient.send
[        ]     | package:pub/src/http.dart 194:43                   _ThrowingClient.send
[        ]     | package:http_throttle/http_throttle.dart 33:31     ThrottleClient.send
[        ]     | ===== asynchronous gap ===========================
[        ]     | dart:async                                         _asyncThenWrapperHelper
[        ]     | package:http_throttle/http_throttle.dart           ThrottleClient.send
[   +2 ms]     | package:http/src/base_client.dart 169:38           BaseClient._sendUnstreamed
[        ]     | package:http/src/base_client.dart 32:7             BaseClient.get
[   +1 ms]     | package:http/src/base_client.dart 117:12           BaseClient.read
[        ]     | package:pub/src/source/hosted.dart 160:31          BoundHostedSource.doGetVersions
[        ]     | package:pub/src/source.dart 167:12                 BoundSource.getVersions
[        ]     | package:pub/src/solver/package_lister.dart 76:44   PackageLister._versions.<fn>.<fn>
[        ]     | dart:async                                         runZoned
[        ]     | package:pub/src/http.dart 272:10                   withDependencyType
[        ]     | package:pub/src/solver/package_lister.dart 75:33   PackageLister._versions.<fn>
[        ]     | dart:async                                         new Future.sync
[        ]     | package:async/src/async_memoizer.dart 43:42        AsyncMemoizer.runOnce
[        ]     | package:pub/src/solver/package_lister.dart 74:58   PackageLister._versions
[        ]     | package:pub/src/solver/package_lister.dart 111:21  PackageLister.countVersions
[        ]     | package:pub/src/solver/version_solver.dart 354:44  VersionSolver._choosePackageVersion.<fn>
[        ]     | package:pub/src/utils.dart 301:39                  minByAsync
[   +2 ms]     | ===== asynchronous gap ===========================
[        ]     | dart:async                                         _asyncThenWrapperHelper
[   +1 ms]     | package:pub/src/utils.dart                         minByAsync
[        ]     | package:pub/src/solver/version_solver.dart 350:25  VersionSolver._choosePackageVersion
[        ]     | package:pub/src/solver/version_solver.dart 97:22   VersionSolver.solve
[        ]     | ===== asynchronous gap ===========================
[        ]     | dart:async                                         _asyncThenWrapperHelper
[        ]     | package:pub/src/solver/version_solver.dart         VersionSolver.solve
[        ]     | package:pub/src/solver.dart 35:10                  resolveVersions.<fn>
[        ]     | package:pub/src/log.dart 378:18                    progress
[        ]     | package:pub/src/solver.dart 32:10                  resolveVersions
[        ]     | package:pub/src/entrypoint.dart 217:24             Entrypoint.acquireDependencies
[        ]     | package:pub/src/command/get.dart 41:23             GetCommand.run
[        ]     | package:args/command_runner.dart 197:27            CommandRunner.runCommand
[        ]     | package:pub/src/command_runner.dart 171:39         PubCommandRunner.runCommand.<fn>
[        ]     | dart:async                                         new Future.sync
[   +2 ms]     | package:pub/src/utils.dart 109:12                  captureErrors.<fn>
[        ]     | package:stack_trace                                Chain.capture
[   +1 ms]     | package:pub/src/utils.dart 122:11                  captureErrors
[        ]     | package:pub/src/command_runner.dart 171:13         PubCommandRunner.runCommand
[+1277 ms] IO  : Retry #3 for GET https://pub.dartlang.org/api/packages/cupertino_icons...
[   +4 ms] IO  : HTTP GET https://pub.dartlang.org/api/packages/cupertino_icons
[        ]     | Accept: application/vnd.pub.v2+json
[        ]     | X-Pub-OS: windows
[        ]     | X-Pub-Command: get
[        ]     | X-Pub-Session-ID: 12B32BE8-FB1F-481E-B6B4-8A8C643EEF43
[        ]     | X-Pub-Environment: flutter_cli:create
[        ]     | X-Pub-Reason: direct
[        ]     | user-agent: Dart pub 2.7.0
[ +260 ms] IO  : HTTP error:
[   +1 ms]     | HandshakeException: Handshake error in client (OS Error:
[        ]     |        CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(handshake.cc:354))
[        ]     |
[        ]     | dart:_http                                         _HttpClient.openUrl
[        ]     | package:http/src/io_client.dart 33:36              IOClient.send
[        ]     | package:pub/src/http.dart 68:39                    _PubHttpClient.send
[        ]     | package:http_retry/http_retry.dart 97:33           RetryClient.send
[        ]     | ===== asynchronous gap ===========================
[        ]     | dart:async                                         _asyncThenWrapperHelper
[        ]     | package:http_retry/http_retry.dart                 RetryClient.send
[        ]     | package:pub/src/http.dart 194:43                   _ThrowingClient.send
[        ]     | package:http_throttle/http_throttle.dart 33:31     ThrottleClient.send
[        ]     | ===== asynchronous gap ===========================
[        ]     | dart:async                                         

运行 flutter pub get --verbose 会出现此错误:

[ +259 ms] IO  : HTTP error:
[   +2 ms]     | HandshakeException: Handshake error in client (OS Error:
[        ]     |        CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(handshake.cc:354))

这可能是因为公司防火墙或证书,但我不确定这里需要做什么。我曾经能够在同一环境中的旧笔记本电脑上正常运行颤振。现在我有一台新笔记本电脑,所以不确定发生了什么变化。

感谢您对此的任何帮助。 阿里

【问题讨论】:

当我以安全模式登录时它可以工作。看起来它与我们机器中安装的 blue coat 统一代理有关。我会看看如何绕过它。 【参考方案1】:

问题解决了。 Symantaic Endpoint Protection 配置为使用 blue coat 代理,并且还安装了统一代理。因此,他们似乎彼此冲突。删除统一代理后,现在我不再收到该错误。

【讨论】:

以上是关于Flutter 创建导致错误 尝试在 https://pub.dartlang.org 找到包 cupertino_icons 时出现 TLS 错误的主要内容,如果未能解决你的问题,请参考以下文章

在 DropdownButton 中选择 Item 会导致 Flutter 抛出错误

Firebase + Flutter - 云函数 onCall 导致 Android 应用出现“未经身份验证”错误

无法解析URL“ https://pub.dartlang.org”。错误(69):无法“发布升级”颤动工具。 5秒钟后重试…(还剩9次尝试)

webview_flutter 在 iOS 中存档时导致问题

Flutter 更新导致包错误

在 deactivate() 中调用 notifyListeners() 会导致错误 - Flutter