-2

I have an android project and I wrote some test cases in androidTest. When I run test cases, it will generate two apk files: one is my application and another is test app. I have changed minSdkVersion in build.gradle to 18 but the minSdkVersion of test app is still 25. Could some tell me how to change the minSdkVersion for androidTest ?

Xinyu Wang
  • 41
  • 1
  • 4

1 Answers1

0

You can probably create a new product flavor for your tests in Android Studio and override the minSdkVersion property. Here is the documentation : https://developer.android.com/studio/build/build-variants#product-flavors

Also, you can take a look to this answer : https://stackoverflow.com/a/31880936/7947225

Vince
  • 2,551
  • 1
  • 17
  • 22
  • yes, I have added a new flavor and set the minSdkVersion to 18. However, the produced test apk's minSdkVersion is still 25. That answer I have tried but it does work. It seems that there is a invisible AndroidManifest for androidTest – Xinyu Wang Jul 02 '18 at 08:20