Build Failed With An Exception in Android Studio

Why wouldn’t my android project build

FAILURE: Build failed with an exception.

  • What went wrong:
    org/gradle/internal/resource/transport/http/HttpClientHelper

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 0s

Facing the same issue. If you find out solution drop it in the comment.
I have tried using another gradle path and then syncing with the gradle files. Nothing changed.