flutterdart

Got TLS error trying to find package. TLS Error When Running flutter doctor or pub upgrade


I recently updated Flutter to version 3.29.2, and since then, I have been experiencing issues when running flutter doctor or pub upgrade. The error message I receive is:

flutter doctor
Building flutter tool.
Running pub upgrade - -.
Resolving dependencies ..
Got TLS error trying to find package crypto at https://pub.dev.
Error <69>: Unable to
Ratseconds ... (9 tries left>

flutter tool. Retrying in five

Waiting for 0 seconds, press CTRL+C to quit
Running pub upgrade.
Resolving dependencies ... (41.6s>_

I have tried the following solutions, but the issue persists:

Checked my internet connection and ensured https://pub.dev is accessible from my browser.

Used a VPN to bypass possible network restrictions.

Ran flutter upgrade --force, but the error remains.

Deleted the bin/cache folder inside the Flutter directory and retried flutter doctor.

Unset any proxy settings using flutter config --unset http-proxy and flutter config --unset https-proxy.

Ran dart pub upgrade separately before running flutter doctor.

Executed all commands with administrator privileges.

The issue only started occurring after updating to Flutter 3.29.2 Previous versions worked fine.

System Info: OS: Windows 10 (64-bit)

Flutter version: 3.29.2

Dart version: (from flutter --version)

Network: No proxy, direct internet access

Has anyone else encountered this issue with Flutter 3.29.2? Any solutions or workarounds would be greatly appreciated!


Solution

  • Solution:

    āœ… 1: Open Command Prompt (CMD) as administrator.
    āœ… 2: Execute the following command to force the connection over TLS 1.2:

    curl --tlsv1.2 https://pub.flutter-io.cn