android difference between testImplementation and androidTestImplementation in build.gradle

后端 未结 2 1691
无人及你
无人及你 2021-02-01 01:17

I am using andorid studio 3.2 and I am new to testing. I want to add a testing library but I am not getting what should i write in the dependencies section testImplentat

2条回答
  •  闹比i
    闹比i (楼主)
    2021-02-01 01:57

    implementation—The dependency is available in all source sets, including the test source sets.

    testImplementation—The dependency is only available in the test source set.

    androidTestImplementation—The dependency is only available in the androidTest source set.

    Android source sets are :

    main: Contains your app code. This code is shared amongst all different versions of the app you can build (known as build variants)

    androidTest: Contains tests known as instrumented tests.

    test: Contains tests known as local tests.

提交回复
热议问题