【问题标题】:Problem adding a dependency in Android Studio?如何在android studio中添加设计依赖?
【发布时间】:2019-11-12 21:44:38
【问题描述】:

我在 android studio 中添加依赖项时遇到问题。我要补充

com.android.support:design:28.0.0' 到依赖项

但我收到这样的错误

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
}

ERROR: Manifest merger failed with multiple errors, see logs

【问题讨论】:

  • 嗨,请把你得到的所有依赖贴在dependencies下
  • 正确格式化代码(使用CTRL+K或反引号)并发布清单合并日志:)
  • 我已经发布了所有依赖@Dor

标签: java android gridle


【解决方案1】:

您正在使用 androidx 和 android 支持库。将 android 支持库替换为现有的 androidx 库。

  androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'

你可以找到他们的androidx版本here

【讨论】:

  • 您提供的代码 sn-p 的用途是什么?
  • 您需要将这些库更改为各自的 androidx 版本。
  • 使用com.google.android.material 还不够吗?它包括支持/设计。
  • 但是你不能同时使用这两个库。
  • 是的,每个人都知道,这是旧闻。只需使用我说的包,因为它包含支持/设计。您的消息:You need change these library with their respective androidx version 略有错误,因为并非每个包都需要 AndroidX 等效项。
猜你喜欢
  • 2017-05-21
  • 2015-03-13
  • 2015-07-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-08-26
  • 1970-01-01
相关资源
最近更新 更多