首页 > 解决方案 > Gradle - 找不到 androidx.core:core:1.0.0

问题描述

我正在尝试使用 gms:play-services-location 并在项目中使用这些依赖项列表,但 gradle 找不到它们中的任何一个并不断给出 403 和 404 错误:

    implementation 'com.google.android.material:material:1.3.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation "com.mikepenz:materialdrawer:6.1.2"
    implementation 'com.aurelhubert:ahbottomnavigation:2.3.4'
    implementation 'com.github.gongw:verifycodeview:1.0.2'
    implementation 'com.nabinbhandari.android:permissions:3.8'
    implementation 'com.google.android.gms:play-services-location:17.0.0'

梯度错误:

Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find androidx.appcompat:appcompat:1.2.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/appcompat/appcompat/1.2.0/appcompat-1.2.0.pom
       - https://jcenter.bintray.com/androidx/appcompat/appcompat/1.2.0/appcompat-1.2.0.pom
       - https://www.jitpack.io/androidx/appcompat/appcompat/1.2.0/appcompat-1.2.0.pom
     Required by:
         project :app
   > Could not find com.google.android.material:material:1.3.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/android/material/material/1.3.0/material-1.3.0.pom
       - https://jcenter.bintray.com/com/google/android/material/material/1.3.0/material-1.3.0.pom
       - https://www.jitpack.io/com/google/android/material/material/1.3.0/material-1.3.0.pom
     Required by:
         project :app
   > Could not find androidx.constraintlayout:constraintlayout:2.0.4.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/constraintlayout/constraintlayout/2.0.4/constraintlayout-2.0.4.pom
       - https://jcenter.bintray.com/androidx/constraintlayout/constraintlayout/2.0.4/constraintlayout-2.0.4.pom
       - https://www.jitpack.io/androidx/constraintlayout/constraintlayout/2.0.4/constraintlayout-2.0.4.pom
     Required by:
         project :app
   > Could not find com.google.android.gms:play-services-location:18.0.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-location/18.0.0/play-services-location-18.0.0.pom
       - https://jcenter.bintray.com/com/google/android/gms/play-services-location/18.0.0/play-services-location-18.0.0.pom
       - https://www.jitpack.io/com/google/android/gms/play-services-location/18.0.0/play-services-location-18.0.0.pom
     Required by:
         project :app
   > Could not find androidx.appcompat:appcompat:1.2.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/appcompat/appcompat/1.2.0/appcompat-1.2.0.pom
       - https://jcenter.bintray.com/androidx/appcompat/appcompat/1.2.0/appcompat-1.2.0.pom
       - https://www.jitpack.io/androidx/appcompat/appcompat/1.2.0/appcompat-1.2.0.pom
     Required by:
         project :app > com.mikepenz:materialdrawer:6.1.2
         project :app > com.mikepenz:materialdrawer:6.1.2 > com.mikepenz:materialize:1.2.0
         project :app > com.mikepenz:materialdrawer:6.1.2 > com.mikepenz:iconics-core:3.1.0
         project :app > com.mikepenz:materialdrawer:6.1.2 > com.mikepenz:fastadapter:3.3.0
         project :app > com.mikepenz:materialdrawer:6.1.2 > com.mikepenz:fastadapter-extensions-expandable:3.3.0
         project :app > com.mikepenz:materialdrawer:6.1.2 > com.mikepenz:fastadapter-extensions-expandable:3.3.0 > com.mikepenz:fastadapter-commons:3.3.0
   > Could not find androidx.annotation:annotation:1.0.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/annotation/annotation/1.0.0/annotation-1.0.0.pom
       - https://jcenter.bintray.com/androidx/annotation/annotation/1.0.0/annotation-1.0.0.pom
       - https://www.jitpack.io/androidx/annotation/annotation/1.0.0/annotation-1.0.0.pom
     Required by:
         project :app > com.mikepenz:materialdrawer:6.1.2
         project :app > com.mikepenz:materialdrawer:6.1.2 > androidx.recyclerview:recyclerview:1.0.0
         project :app > com.mikepenz:materialdrawer:6.1.2 > com.mikepenz:fastadapter:3.3.0
         project :app > com.mikepenz:materialdrawer:6.1.2 > com.mikepenz:fastadapter-extensions-expandable:3.3.0
         project :app > com.mikepenz:materialdrawer:6.1.2 > androidx.recyclerview:recyclerview:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0
         project :app > com.mikepenz:materialdrawer:6.1.2 > com.mikepenz:fastadapter-extensions-expandable:3.3.0 > com.mikepenz:fastadapter-commons:3.3.0
         project :app > com.mikepenz:materialdrawer:6.1.2 > androidx.recyclerview:recyclerview:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0 > androidx.customview:customview:1.0.0
         project :app > com.mikepenz:materialdrawer:6.1.2 > androidx.recyclerview:recyclerview:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0 > androidx.viewpager:viewpager:1.0.0
         project :app > com.mikepenz:materialdrawer:6.1.2 > androidx.recyclerview:recyclerview:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0 > androidx.drawerlayout:drawerlayout:1.0.0
         project :app > com.mikepenz:materialdrawer:6.1.2 > androidx.recyclerview:recyclerview:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0 > androidx.interpolator:interpolator:1.0.0
         project :app > com.mikepenz:materialdrawer:6.1.2 > androidx.recyclerview:recyclerview:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0 > androidx.cursoradapter:cursoradapter:1.0.0
   > Could not find com.google.android.material:material:1.3.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/android/material/material/1.3.0/material-1.3.0.pom
       - https://jcenter.bintray.com/com/google/android/material/material/1.3.0/material-1.3.0.pom
       - https://www.jitpack.io/com/google/android/material/material/1.3.0/material-1.3.0.pom
     Required by:
         project :app > com.mikepenz:materialdrawer:6.1.2
         project :app > com.aurelhubert:ahbottomnavigation:2.3.4
         project :app > com.mikepenz:materialdrawer:6.1.2 > com.mikepenz:materialize:1.2.0
   > Could not find androidx.constraintlayout:constraintlayout:2.0.4.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/constraintlayout/constraintlayout/2.0.4/constraintlayout-2.0.4.pom
       - https://jcenter.bintray.com/androidx/constraintlayout/constraintlayout/2.0.4/constraintlayout-2.0.4.pom
       - https://www.jitpack.io/androidx/constraintlayout/constraintlayout/2.0.4/constraintlayout-2.0.4.pom
     Required by:
         project :app > com.mikepenz:materialdrawer:6.1.2
   > Could not find androidx.core:core:1.0.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/core/core/1.0.0/core-1.0.0.pom
       - https://jcenter.bintray.com/androidx/core/core/1.0.0/core-1.0.0.pom
       - https://www.jitpack.io/androidx/core/core/1.0.0/core-1.0.0.pom
     Required by:
         project :app > com.mikepenz:materialdrawer:6.1.2 > androidx.recyclerview:recyclerview:1.0.0
         project :app > com.mikepenz:materialdrawer:6.1.2 > androidx.recyclerview:recyclerview:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0
         project :app > com.mikepenz:materialdrawer:6.1.2 > androidx.recyclerview:recyclerview:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0 > androidx.customview:customview:1.0.0
         project :app > com.mikepenz:materialdrawer:6.1.2 > androidx.recyclerview:recyclerview:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0 > androidx.viewpager:viewpager:1.0.0
         project :app > com.mikepenz:materialdrawer:6.1.2 > androidx.recyclerview:recyclerview:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0 > androidx.drawerlayout:drawerlayout:1.0.0
   > Could not find androidx.legacy:legacy-support-core-utils:1.0.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/legacy/legacy-support-core-utils/1.0.0/legacy-support-core-utils-1.0.0.pom
       - https://jcenter.bintray.com/androidx/legacy/legacy-support-core-utils/1.0.0/legacy-support-core-utils-1.0.0.pom
       - https://www.jitpack.io/androidx/legacy/legacy-support-core-utils/1.0.0/legacy-support-core-utils-1.0.0.pom
     Required by:
         project :app > com.mikepenz:materialdrawer:6.1.2 > androidx.recyclerview:recyclerview:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0
   > Could not find androidx.coordinatorlayout:coordinatorlayout:1.0.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/coordinatorlayout/coordinatorlayout/1.0.0/coordinatorlayout-1.0.0.pom
       - https://jcenter.bintray.com/androidx/coordinatorlayout/coordinatorlayout/1.0.0/coordinatorlayout-1.0.0.pom
       - https://www.jitpack.io/androidx/coordinatorlayout/coordinatorlayout/1.0.0/coordinatorlayout-1.0.0.pom
     Required by:
         project :app > com.mikepenz:materialdrawer:6.1.2 > androidx.recyclerview:recyclerview:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0
   > Could not find androidx.slidingpanelayout:slidingpanelayout:1.0.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/slidingpanelayout/slidingpanelayout/1.0.0/slidingpanelayout-1.0.0.pom
       - https://jcenter.bintray.com/androidx/slidingpanelayout/slidingpanelayout/1.0.0/slidingpanelayout-1.0.0.pom
       - https://www.jitpack.io/androidx/slidingpanelayout/slidingpanelayout/1.0.0/slidingpanelayout-1.0.0.pom
     Required by:
         project :app > com.mikepenz:materialdrawer:6.1.2 > androidx.recyclerview:recyclerview:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0
   > Could not find androidx.swiperefreshlayout:swiperefreshlayout:1.0.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/swiperefreshlayout/swiperefreshlayout/1.0.0/swiperefreshlayout-1.0.0.pom
       - https://jcenter.bintray.com/androidx/swiperefreshlayout/swiperefreshlayout/1.0.0/swiperefreshlayout-1.0.0.pom
       - https://www.jitpack.io/androidx/swiperefreshlayout/swiperefreshlayout/1.0.0/swiperefreshlayout-1.0.0.pom
     Required by:
         project :app > com.mikepenz:materialdrawer:6.1.2 > androidx.recyclerview:recyclerview:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0
   > Could not find androidx.asynclayoutinflater:asynclayoutinflater:1.0.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/asynclayoutinflater/asynclayoutinflater/1.0.0/asynclayoutinflater-1.0.0.pom
       - https://jcenter.bintray.com/androidx/asynclayoutinflater/asynclayoutinflater/1.0.0/asynclayoutinflater-1.0.0.pom
       - https://www.jitpack.io/androidx/asynclayoutinflater/asynclayoutinflater/1.0.0/asynclayoutinflater-1.0.0.pom
     Required by:
         project :app > com.mikepenz:materialdrawer:6.1.2 > androidx.recyclerview:recyclerview:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

这是 google 在此LINK中提供的依赖项设置:
implementation 'com.google.android.gms:play-services-location:18.0.0'


Gradle 离线工作未选中。互联网连接已测试。我正在使用代理,它已经过测试并且可以正常工作。也尝试使用VPN,但没有区别。

标签: androidgradle

解决方案


这是因为如果制裁 Connect a vpn Invalidate cache and restart Delete ~/.gradlefolder and press sync then run


推荐阅读