gpt4 book ai didi

android - 无法解析符号 'LargeTest'

转载 作者:太空狗 更新时间:2023-10-29 13:12:16 27 4
gpt4 key购买 nike

我正在将所有测试转换为 Testing Support Library .但是,当我尝试像这样导入 LargeTest 注释时

import android.support.test.filters.LargeTest;

我得到 Cannot resolve symbol 'LargeTest'。我需要将什么依赖项添加到我的 gradle 文件中才能解决此错误?

最佳答案

你有没有通过this文档?

您需要根据需要添加其中一些依赖项。

dependencies {
androidTestCompile 'com.android.support.test:runner:0.4'
// Set this dependency to use JUnit 4 rules
androidTestCompile 'com.android.support.test:rules:0.4'
// Set this dependency to build and run Espresso tests
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
// Set this dependency to build and run UI Automator tests
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
}

并添加:

android {
defaultConfig {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
}

关于android - 无法解析符号 'LargeTest',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38964778/

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