无法解决依赖关系。?
Posted
技术标签:
【中文标题】无法解决依赖关系。?【英文标题】:Failed to resolve dependencies .? 【发布时间】:2016-02-16 21:30:26 【问题描述】:您好,我刚刚将我的 android studio 项目从一台电脑导入到另一台电脑,在构建它时显示错误,在离线模式下构建项目时检测到未解决的依赖项。我在 Gradle 设置中未选中 OFFLINE WORK。取消选中后,它现在显示错误
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find com.android.support:support-v4:23.0.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-v4/23.0.1/support-v4-23.0.1.pom
https://jcenter.bintray.com/com/android/support/support-v4/23.0.1/support-v4-23.0.1.jar
file:/C:/Users/user/AppData/Local/Android/sdk1/extras/android/m2repository/com/android/support/support-v4/23.0.1/support-v4-23.0.1.pom
file:/C:/Users/user/AppData/Local/Android/sdk1/extras/android/m2repository/com/android/support/support-v4/23.0.1/support-v4-23.0.1.jar
file:/C:/Users/user/AppData/Local/Android/sdk1/extras/google/m2repository/com/android/support/support-v4/23.0.1/support-v4-23.0.1.pom
file:/C:/Users/user/AppData/Local/Android/sdk1/extras/google/m2repository/com/android/support/support-v4/23.0.1/support-v4-23.0.1.jar
Required by:
TheFlame:app:unspecified > com.android.support:appcompat-v7:22.2.0
TheFlame:app:unspecified > com.android.support:design:22.2.0
TheFlame:app:unspecified > com.android.support:recyclerview-v7:22.2.0
找不到 com.android.support:support-v4:23.0.1。 在以下位置搜索: https://jcenter.bintray.com/com/android/support/support-v4/23.0.1/support-v4-23.0.1.pom https://jcenter.bintray.com/com/android/support/support-v4/23.0.1/support-v4-23.0.1.jar 文件:/C:/Users/user/AppData/Local/Android/sdk1/extras/android/m2repository/com/android/support/support-v4/23.0.1/support-v4-23.0.1.pom 文件:/C:/Users/user/AppData/Local/Android/sdk1/extras/android/m2repository/com/android/support/support-v4/23.0.1/support-v4-23.0.1.jar 文件:/C:/Users/user/AppData/Local/Android/sdk1/extras/google/m2repository/com/android/support/support-v4/23.0.1/support-v4-23.0.1.pom 文件:/C:/Users/user/AppData/Local/Android/sdk1/extras/google/m2repository/com/android/support/support-v4/23.0.1/support-v4-23.0.1.jar 要求: TheFlame:app:unspecified > me.dm7.barcodescanner:zxing:1.8.3 > me.dm7.barcodescanner:core:1.8.3
谁能帮我解决这个问题。
【问题讨论】:
请发布您的 build.gradle,也许您必须下载 sdk... 【参考方案1】:Similiar Issue
确保在SDK Manager
中同时更新“Android Support Repository”和“Android Support Library”并确保在 Android Studio 中完成 Gradle Sync。
【讨论】:
【参考方案2】:试试这个:
1) 打开 SDK 管理器
2) 启动独立 SDK 管理器
3) 支持库的附加功能和检查更新
4) 安装它
5) 同步 Gradle
【讨论】:
我已经下载了最新的支持库 23.1.1 仍然显示同样的错误 你已经编译了 com.android.support:support-v4:23.1.1 ??发布 build.gradle以上是关于无法解决依赖关系。?的主要内容,如果未能解决你的问题,请参考以下文章