'android.support.test.espresso does not exist' when I want to use it to individual apk test

前端 未结 6 1290
-上瘾入骨i
-上瘾入骨i 2021-02-03 12:09

I need to do some auto testing jobs to an Android application without its source code. I found both robotium and espresso can do this job, I decided to use espresso because its

6条回答
  •  北荒
    北荒 (楼主)
    2021-02-03 12:18

    I had this same issue, one thing that was ruining my test build is the following line:

    main { java.srcDirs = ['src/main/java', 'src/AndroidTests', 'src/AndroidTest/java'] }
    

    Remove test code from srcDirs:

    sourceSets {
        ....
        main { java.srcDirs = ['src/main/java'] }
    }
    

提交回复
热议问题