Android 运行浓缩咖啡测试时出错:无静态字段无类型的\u OP\u控制的\u活套

Android 运行浓缩咖啡测试时出错:无静态字段无类型的\u OP\u控制的\u活套,android,kotlin,android-espresso,ui-testing,Android,Kotlin,Android Espresso,Ui Testing,我在运行测试时遇到此错误: **No static field NO_OP_CONTROLLED_LOOPER of type** 即使测试是空的,只需使用如下的check()函数: check(matches(isDisplayed())); 我搜索了一下,但找不到任何相关信息,所以在我解决了问题后,我决定在这里与其他人分享。 我使用的是这两个版本: // Espresso def androidx_test_espresso = "3.2.0" androidTest

我在运行测试时遇到此错误:

**No static field NO_OP_CONTROLLED_LOOPER of type**
即使测试是空的,只需使用如下的check()函数:

check(matches(isDisplayed()));
我搜索了一下,但找不到任何相关信息,所以在我解决了问题后,我决定在这里与其他人分享。 我使用的是这两个版本:

// Espresso
def androidx_test_espresso = "3.2.0"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidx_test_espresso"

// androidx.test
def androidx_test = "1.2.0"
androidTestImplementation "androidx.test:runner:$androidx_test"
androidTestImplementation "androidx.test:core:$androidx_test"
androidTestImplementation "androidx.test.ext:junit-ktx:$androidx_test"
我可以通过将版本更改为:

def androidx_test_espresso = "3.1.0"
def androidx_test = "1.1.0"
可能上面的版本不匹配

我希望这个话题能帮助你们:)