gpt4 book ai didi

android - 错误 :Failed to resolve: wearable

转载 作者:行者123 更新时间:2023-11-29 18:52:47 27 4
gpt4 key购买 nike

我有一个现有项目,当我尝试向其中添加 wear 模块时,显示以下错误。当我使用 wear 模块创建一个新项目时,它正在运行。

Error:Failed to resolve: wearable

project depends of com.google.android.support:wearable:2.3.0 so it must also depend com.google.android.wearable:wearable:2.3.0

错误截图

enter image description here

最佳答案

你需要像这样添加一个provided

...
provided 'com.google.android.wearable:wearable:2.3.0'
implementation 'com.google.android.support:wearable:2.3.0'
...

还要检查您的项目级别 build.gradle 是否具有 google 存储库,我认为现在一些可穿戴库来自 google 而不是 jcenter。

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()
flatDir {
dirs 'libs'
}
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation"
}
}

关于android - 错误 :Failed to resolve: wearable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50563581/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com