Не удалось разрешить все файлы для конфигурации ': classpath' - PullRequest
0 голосов
/ 04 января 2019

Я занимаюсь разработкой примера приложения на реагирующем языке, я столкнулся с этой проблемой, когда запускал эмулятор Android. У меня версия sdk tool - 25, но я не знаю, как это происходит. Пожалуйста, дайте мне совет.

> Could not resolve all files for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:3.1.0.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:3.1.0.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.0/gradle-3.1.0.pom'.
            > org.apache.http.ssl.SSLInitializationException: \Library\Java\Home\jre\lib\security\cacerts (The system cannot find the path specified)
      > Could not resolve com.android.tools.build:gradle:3.1.0.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.0/gradle-3.1.0.pom'.
            > org.apache.http.ssl.SSLInitializationException: \Library\Java\Home\jre\lib\security\cacerts (The system cannot find the path specified)
   > Could not resolve com.google.gms:google-services:3.2.0.
     Required by:
         project :
      > Could not resolve com.google.gms:google-services:3.2.0.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/3.2.0/google-services-3.2.0.pom'.
            > org.apache.http.ssl.SSLInitializationException: \Library\Java\Home\jre\lib\security\cacerts (The system cannot find the path specified)
      > Could not resolve com.google.gms:google-services:3.2.0.
         > Could not get resource 'https://jcenter.bintray.com/com/google/gms/google-services/3.2.0/google-services-3.2.0.pom'.
            > org.apache.http.ssl.SSLInitializationException: \Library\Java\Home\jre\lib\security\cacerts (The system cannot find the path specified)

* 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

Ответы [ 2 ]

0 голосов
/ 06 января 2019

Попробуйте использовать

classpath 'com.android.tools.build:gradle:3.0.1'

, а затем очистите и восстановите.

0 голосов
/ 04 января 2019

Ваш проект не может получить доступ к URL для загрузки необходимых библиотек.Скорее всего, это проблема конфигурации gradle.

Измените свой уровень проекта build.gradle файл следующим образом:

buildscript {
repositories {

    google()
   jcenter()
}

dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'  
}

}

Обновите

Если это не такне работает, попробуйте это тоже:

  repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha2'
        ...
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
    }
}
...