如何为androidTest设置minSdkVersion

问题描述 投票:-2回答:1

我有一个android项目,我在androidTest中编写了一些测试用例。当我运行测试用例时,它将生成两个apk文件:一个是我的应用程序,另一个是测试应用程序。我已经将build.gradle中的minSdkVersion更改为18但测试应用程序的minSdkVersion仍然是25.有人能告诉我如何更改androidTest的minSdkVersion吗?

android android-testing
1个回答
0
投票

您可以在Android Studio中为测试创建新的产品风格并覆盖minSdkVersion属性。这是文档:https://developer.android.com/studio/build/build-variants#product-flavors

此外,你可以看看这个答案:https://stackoverflow.com/a/31880936/7947225

© www.soinside.com 2019 - 2024. All rights reserved.