Ошибка в файле Android gradle с использованием flutter

#android #flutter #gradle

Вопрос:

Когда я создавал приложение, я получил эти сообщения об ошибках. Я старался изо всех сил, но не мог найти хорошего решения. Пожалуйста, помогите мне. Я публикую свой журнал ошибок ниже.

 > A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:4.1.0.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:4.1.0.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.0/gradle-4.1.0.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.0/gradle-4.1.0.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/6.8/userguide/build_environment.html#gradle_system_properties
                  > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:1.3.0.
     Required by:
         project :
      > Could not resolve com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:1.3.0.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/android/libraries/mapsplatform/secrets-gradle-plugin/secrets-gradle-plugin/1.3.0/secrets-gradle-plugin-1.3.0.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/com/google/android/libraries/mapsplatform/secrets-gradle-plugin/secrets-gradle-plugin/1.3.0/secrets-gradle-plugin-1.3.0.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/6.8/userguide/build_environment.html#gradle_system_properties
                  > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve com.google.gms:google-services:4.3.3.
     Required by:
         project :
      > Could not resolve com.google.gms:google-services:4.3.3.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/6.8/userguide/build_environment.html#gradle_system_properties
                  > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
 

Комментарии:

1. кто-нибудь мне поможет, пожалуйста

2. Почему вы используете gradle 4.1? Перейдите к своему файлу gradle-wrapper.properties и измените URL-адрес в соответствии с последней версией. Заменить distributionUrl=https://services.gradle.org/distributions/gradle-4.1.0-bin.zip на distributionUrl=https://services.gradle.org/distributions/gradle-7.2.0-bin.zip и в build.gradle заменить com.android.tools.build:gradle:4.1.0 на com.android.tools.build:gradle:7.2.0

3. когда я использую это, то он показывает эту ошибку [!]. Gradle выдал ошибку при загрузке артефактов из сети. Повторная попытка загрузки… Исключение в потоке «основной» java.io.FileNotFoundException: downloads.gradle-dn.com/distributions/gradle-7.2.0-bin.zip в sun.net.www.протокол.http. HttpURLConnection.getInputStream0(HttpURLConnection.java:1896) в sun.net.www.протокол.http. HttpURLConnection.getInputStream(HttpURLConnection.java:1498) в sun.net.www.протокол.https. HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)