Android studio 报错 Error:(24, 13) Failed to resolve: com.android.support:recyclerview-v7:20.+
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
Error:(25, 13) Failed to resolve: com.android.support:leanback-v17:20.+
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
点击运行 报
Error:A problem occurred configuring project ':myapplication'.
> Could not resolve all dependencies for configuration ':myapplication:_debugCompile'.
> Could not find any version that matches com.android.support:recyclerview-v7:20.+.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/recyclerview-v7/maven-metadata.xml
https://jcenter.bintray.com/com/android/support/recyclerview-v7/
file:/D:/adt/adt-bundle-windows-x86_64-20140702/sdk/extras/android/m2repository/com/android/support/recyclerview-v7/maven-metadata.xml
file:/D:/adt/adt-bundle-windows-x86_64-20140702/sdk/extras/google/m2repository/com/android/support/recyclerview-v7/maven-metadata.xml
file:/D:/adt/adt-bundle-windows-x86_64-20140702/sdk/extras/google/m2repository/com/android/support/recyclerview-v7/
Required by:
MyApplication2:myapplication:unspecified
> Could not find any version that matches com.android.support:leanback-v17:20.+.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/leanback-v17/maven-metadata.xml
https://jcenter.bintray.com/com/android/support/leanback-v17/
file:/D:/adt/adt-bundle-windows-x86_64-20140702/sdk/extras/android/m2repository/com/android/support/leanback-v17/maven-metadata.xml
file:/D:/adt/adt-bundle-windows-x86_64-20140702/sdk/extras/google/m2repository/com/android/support/leanback-v17/maven-metadata.xml
file:/D:/adt/adt-bundle-windows-x86_64-20140702/sdk/extras/google/m2repository/com/android/support/leanback-v17/
Required by:
MyApplication2:myapplication:unspecified
> Could not resolve all dependencies for configuration ':myapplication:_debugCompile'.
> Could not find any version that matches com.android.support:recyclerview-v7:20.+.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/recyclerview-v7/maven-metadata.xml
https://jcenter.bintray.com/com/android/support/recyclerview-v7/
file:/D:/adt/adt-bundle-windows-x86_64-20140702/sdk/extras/android/m2repository/com/android/support/recyclerview-v7/maven-metadata.xml
file:/D:/adt/adt-bundle-windows-x86_64-20140702/sdk/extras/google/m2repository/com/android/support/recyclerview-v7/maven-metadata.xml
file:/D:/adt/adt-bundle-windows-x86_64-20140702/sdk/extras/google/m2repository/com/android/support/recyclerview-v7/
Required by:
MyApplication2:myapplication:unspecified
> Could not find any version that matches com.android.support:leanback-v17:20.+.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/leanback-v17/maven-metadata.xml
https://jcenter.bintray.com/com/android/support/leanback-v17/
file:/D:/adt/adt-bundle-windows-x86_64-20140702/sdk/extras/android/m2repository/com/android/support/leanback-v17/maven-metadata.xml
file:/D:/adt/adt-bundle-windows-x86_64-20140702/sdk/extras/google/m2repository/com/android/support/leanback-v17/maven-metadata.xml
file:/D:/adt/adt-bundle-windows-x86_64-20140702/sdk/extras/google/m2repository/com/android/support/leanback-v17/
Required by:
MyApplication2:myapplication:unspecified
解决方案:
1. 根据路径 找到 file:/D:/adt/adt-bundle-windows-x86_64-20140702/sdk/extras/android/m2repository/com/android/support/leanback-v17/maven-metadata.xml
2.打开maven-metadata。xml
metadata
>
<
groupId
>
com.android.support
</
groupId
>
<
artifactId
>
recyclerview-v7
</
artifactId
>
<
version
>
21.0.0
</
version
>
<
version
>
21.0.0
</
version
>
<
version
>
21.0.2
</
version
>
<
version
>
21.0.3
</
version
>
<
version
>
22.0.0
</
version
>
<
version
>
22.1.0
</
version
>
<
version
>
22.2.0
</
version
>
</
versions
>
<
lastUpdated
>
20150521233210
</
lastUpdated
>
</
versioning
>
</
metadata
>
3. 可以看到版本号是21+,所以更改
com.android.support:recyclerview-v7:20.+为
com.android.support:recyclerview-v7:21.+
同理根据上面方法打开
file:/D:/adt/adt-bundle-windows-x86_64-20140702/sdk/extras/android/m2repository/com/android/support/leanback-v17/maven-metadata.xml
<?
xml version="1.0" encoding="UTF-8"
?>
<
groupId
>
com.android.support
</
groupId
>
<
artifactId
>
leanback-v17
</
artifactId
>
<
version
>
21.0.0
</
version
>
<
version
>
21.0.0
</
version
>
<
version
>
21.0.2
</
version
>
<
version
>
21.0.3
</
version
>
<
version
>
22.0.0
</
version
>
<
version
>
22.1.0
</
version
>
<
version
>
22.2.0
</
version
>
</
versions
>
<
lastUpdated
>
20150521233206
</
lastUpdated
>
</
versioning
>
</
metadata
>