Could not resolve androidx.drawerlayout:drawerlayout:1.0.0

筅森魡賤 提交于 2021-01-29 09:22:58

问题


After updating my android studio from 3.3 to 3.4 I am now getting this error.

ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve androidx.drawerlayout:drawerlayout:1.0.0.
Show Details
Affected Modules: app


ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve androidx.cursoradapter:cursoradapter:1.0.0.
Show Details
Affected Modules: app


ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve androidx.drawerlayout:drawerlayout:1.0.0.
Show Details
Affected Modules: app


ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve androidx.cursoradapter:cursoradapter:1.0.0.
Show Details
Affected Modules: app


ERROR: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve androidx.drawerlayout:drawerlayout:1.0.0.
Show Details
Affected Modules: app


ERROR: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve androidx.cursoradapter:cursoradapter:1.0.0.
Show Details
Affected Modules: app


ERROR: Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve androidx.drawerlayout:drawerlayout:1.0.0.
Show Details
Affected Modules: app


ERROR: Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve androidx.cursoradapter:cursoradapter:1.0.0.
Show Details
Affected Modules: app


ERROR: Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve androidx.drawerlayout:drawerlayout:1.0.0.
Show Details
Affected Modules: app


ERROR: Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve androidx.cursoradapter:cursoradapter:1.0.0.
Show Details
Affected Modules: app

Notice that My project was fine before upgrading Android Studio.

To fix this I tried the following: 1. Adding the two dependencies

    implementation 'androidx.drawerlayout:drawerlayout:1.0.0'
    implementation 'androidx.cursoradapter:cursoradapter:1.0.0'

But the problem is still there.

  1. Invalidate cache and restart.
  2. Clean and rebuild

All of them didn't work.

The dependencies which are seemed not to be resolved are listed here in Google's Maven Repository but android studio could not resolve them. How can I fix this, Any help will be appreciated.


回答1:


I solved my problem by reverting distributionUrl in gradle-wrapper.properties

from

distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

back to

distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

And also reverting gradle dependency in build.gradle from

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

back to

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

This seems like temporary solution though.



来源:https://stackoverflow.com/questions/55807789/could-not-resolve-androidx-drawerlayoutdrawerlayout1-0-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!