我正在寻找一种在 proguard 运行后运行我的 Espresso 测试的方法 - 这应该是一个错误配置的 proguard 的安全网(在将 butterknife 更新到 7.0 之后忘记更新 proguard 配置)
最佳答案
假设您使用 Android Gradle 构建系统内置的标准机制(为特定构建类型设置“minifyEnabled true”)来保护您的 APK,您可以通过设置 testBuildType 来测试您的“保护”APK,如 here 所述并正常运行您的 connectedAndroidTest 任务。
例如,如果您的“release”buildType 被配置为针对它运行 proguard,您可以将以下内容添加到您的 gradle 文件中:
android {
testBuildType "release"
}
关于android - 在 proguard 之后运行 espresso 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31819619/