I am trying to build some automated tests at work for testing a set of Android apps that we have. I have a flavor for building the apps and a flavor for running the automated tests (because UiAutomator requires minApi 18 or higher, but we want to support phones back to Api 15). We also have build types for develop, release, staging, and debug.
I am able to run the AppBuilder flavor on any app on each of the build types no problem. However, when I try to run the automated tests, I can only run them on the debug versions of the apps, and I need to be able to run them on the other types as well.
I have tried running them as JUnit Tests, and they produce the error "Empty test suite". I have also run them as Android Instrumented Tests, and they won't run, as they say that the class isn't a test class.
Also, when I build the automated class, most of my imports turn red and show the "cannot resolve symbol" error (mostly my junit imports and uiautomator imports).
I have looked all over for days for possible solutions and haven't figured anything out yet. I have "testImplementation 'junit:junit:4.12'"
and "androidTestImplementation 'junit:junit:4.12'"
in my build.gradle dependencies, I have tried invalidating caches and restarting, and I have tried clearing all of my configurations and putting them back in (but may have done this incorrectly), but none of this has worked.
Any help would be appreciated!