【问题标题】:Android Studio 3.1.4 implementation 'com.android.support:appcompat-v7:28.0.0-rc01' errorAndroid Studio 3.1.4 实现“com.android.support:appcompat-v7:28.0.0-rc01”错误
【发布时间】:2018-08-13 08:36:15
【问题描述】:

这个错误有什么解决办法吗? 实现 'com.android.support:appcompat-v7:28.0.0-rc01'

错误日志:

所有 com.android.support 库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃)。找到版本 28.0.0-rc01、26.1.0。示例包括 com.android.support:animated-vector-drawable:28.0.0-rc01 和 com.android.support:support-media-compat:26.1.0 less... (Ctrl+F1) 有一些库或工具和库的组合是不兼容的,或者可能导致错误。一种这样的不兼容性是使用不是最新版本的 Android 支持库版本进行编译(或者特别是低于您的 targetSdkVersion 的版本)。

需要我做什么?

这是我的 gradle 文件:

implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    compile 'com.google.firebase:firebase-core:16.0.0'

【问题讨论】:

  • 发布应用的 gradle 文件
  • @kevanaghera 我不明白我需要向 gradle 文件添加什么
  • 转到您的项目结构并检查所有模块依赖项。尝试设置所有支持依赖使用相同的版本。希望你有问题。
  • 仍然通知有错误但它仍然有效

标签: android


【解决方案1】:

只需按照说明进行操作,错误就会消失。在 gradle 文件中添加以下依赖项,因为您必须在项目中使用相同版本的库才能顺利运行应用程序。

实现 'com.android.support:animated-vector-drawable:28.0.0-rc01'
实现 'com.android.support:support-media-compat:28.0.0-rc01'

实际上 android studio 提供了所有信息(错误和警告)来简化开发。

还有一个建议,将 firebase-core 库中的 compile 更改为 implementation

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-01-04
    • 1970-01-01
    • 2019-04-05
    • 2019-01-19
    • 1970-01-01
    • 2020-05-12
    • 1970-01-01
    相关资源
    最近更新 更多