【问题标题】:Android Dependency IssueAndroid 依赖问题
【发布时间】:2017-12-26 06:50:31
【问题描述】:

尝试运行我的应用,这是我从 Gradle 构建中遇到的错误:

Error:A problem occurred configuring project ':app'.

无法解析配置“:app:_debugApkCopy”的所有依赖项。 找不到任何与 com.google.android.gms:play-services-vision:9.4.0.+ 匹配的版本。 不匹配的版本: 11.0.2 11.0.1 11.0.0 10.2.6 10.2.4 + 17 更多 要求: 项目:应用程序

这是我的依赖项的样子:

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
// Important - the CameraSource implementation in this project requires version 8.1 or higher.
compile 'com.android.support:support-v4:24.2.0'
compile 'com.google.android.gms:play-services-vision:9.4.0.+'
compile 'com.android.support:design:24.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'

我尝试通过工具>Android SDK>更新播放服务..
我读过其他一些帖子,人们也有类似的问题,但修复不起作用。我也希望能更多地了解这个问题。

谢谢

【问题讨论】:

  • 您是否尝试将“9.4.0.+”更改为“11.0.2”或错误消息列表中显示的任何其他版本?
  • @Dave 当我改变你的建议时,编译 'com.android.support:support-v4:24.2.0' 给我一个错误,说所有 com.android.support 库必须使用相同的版本.但是,两个支持库都是 24.2.0,如我上面粘贴的依赖项代码所示。

标签: java android gradle dependencies


【解决方案1】:

试试:

  • 彻底清理和重建
  • 卸载/安装 android 支持库

【讨论】:

    【解决方案2】:

    您对“9.4.0.+”的说明不正确。也许你的意思是“9.4.+”,但无论如何动态依赖都不是一个好主意恕我直言。错误消息将您机器上可用的最新版本列为“11.0.2”(这是撰写本文时的最新版本)。改用那个。根据您上面的评论,您的这部分问题显然已经解决了。

    至于您的其他问题(“支持库必须使用相同的版本”),某些东西(play-services-vision 或 constraint-layout)很可能会引入支持库某些部分的不同版本。您应该查看this SO question 以追踪您的依赖项来自何处。您需要确保并使用所有内容的兼容版本。最后,确保您拥有每个版本的最新版本就足够了。

    【讨论】:

      猜你喜欢
      • 2018-04-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-25
      • 2015-03-11
      • 2014-08-09
      • 1970-01-01
      • 2012-05-23
      相关资源
      最近更新 更多