Why is library module android.support.test not visible in add dependency

前端 未结 7 628
时光说笑
时光说笑 2020-12-14 08:01

I am adding Espresso to my project in Android Studio. I have installed the Support Repository and in fact have already been using pieces of it. Then I added these dependenci

相关标签:
7条回答
  • 2020-12-14 08:35

    I had the same issue and I found that the dependencies with the androidTestCompile are visible only by default in the debug build variant.

    You can change the build variant to be tested by adding this to your build.gradle:

    android {
        ...
        testBuildType "staging"
    }
    

    where "staging" is just an example, you should replace it with one of your build variant.

    Remember that only one variant is tested.

    More information here https://code.google.com/p/android/issues/detail?id=98326

    0 讨论(0)
提交回复
热议问题