android - 无法使用 TypeSafeMatcher
问题描述
我正在尝试从此处创建扩展 TypeSafeMatcher 的 ToastMatcher 类,但由于某种原因,上下文操作和手动添加到 gradle 都失败了。给出的上下文操作选项如下:
但选择任一添加库选项都不会改变。所有使用 import 语句的尝试都是徒劳的。这是我的 gradle 依赖项:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'androidx.navigation:navigation-fragment:2.3.5'
implementation 'androidx.navigation:navigation-ui:2.3.5'
implementation 'com.jjoe64:graphview:4.2.2'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation "com.hootsuite.android:nachos:1.1.1"
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test:rules:1.4.0'
implementation "androidx.coordinatorlayout:coordinatorlayout:1.1.0"
testImplementation 'io.rest-assured:rest-assured:4.4.0'
testImplementation 'org.hamcrest:hamcrest:2.2'
implementation 'com.android.volley:volley:1.2.1'
implementation "android.arch.lifecycle:extensions:1.1.1"
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
testImplementation 'com.google.guava:guava:18.0'
testImplementation 'com.squareup.spoon:spoon-client:1.1.1'
testImplementation('com.jakewharton.espresso:espresso:1.1-r3')
}
解决方案
推荐阅读
- apache-spark - PySpark:替换 ArrayType(String) 中的值
- go - 如何将结构中的特定键设置为beego orm中的外键?
- css - 为什么垂直居中需要指定的身体高度而不是宽度?
- c++ - 尝试使用线程通过将计算图像的函数拆分为 2 个线程来使 mandelbrot 设置更快,但我无法让它工作
- php - 如何通过将数组与另一个数组进行比较来从数组中删除数组?
- json - 在 Swift 4 中解析 JSON(初学者)
- angular - 如何在“ng服务”期间解决“意外数字”异常
- ruby-on-rails - 有没有办法提取具有相同列值计算另一列总和的表的所有记录?
- javascript - javascript中的多个数组表
- excel - power bi 表格单元格的条件格式