【问题标题】:Android project update and how to solve: "Failed to resolve: monitor"?Android项目更新以及如何解决:“无法解决:监视器”?
【发布时间】:2018-10-24 09:30:47
【问题描述】:
由于 jcenter() 删除一些旧库的问题,我决定更新我的项目。
所以现在我有:
gradle: 4.6
和:
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:3.0.0'
我几乎解决了所有依赖,但我得到了
Failed to resolve: monitor
不知道那个显示器是什么;(
【问题讨论】:
标签:
android-gradle-plugin
【解决方案1】:
我也一样。如果我评论浓缩咖啡库并且:
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
我找到了解决方案。把 google() 放在开头
buildscript {
repositories {
google()
和
allprojects {
repositories {
google()
在项目gradlew中
【解决方案2】:
在我的项目中,当我删除依赖项时:
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
这个错误消失了。
祝你好运!
【解决方案3】:
由于 espresso-core,我遇到了同样的问题。
但是我解决了这个问题。
尝试更改您的 build.gradle,如下所示:-
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2',{
exclude group: 'com.android.support', module: 'support-annotations'
})
}