Skip to content Skip to sidebar Skip to footer

Could Not Be Found Or Has No Tests In Junit

I am trying to test setting application using JunitTestcase.My class extends ActivityInstrumentationTestCase2. But while executing I am getting this error: 01-12 17:22:11.519: WA

Solution 1:

I had similar issue, after spending two days I solved it..

Test class path : app/src/androidTest/java/your-pkg-name/example_classTest.java

java file path : app/src/main/java/your-pkg-name/example_class.java

and you should clearly define below code in your app gradle

android{

      sourceSets {

         androidTest {
              java.srcDirs = ['src/androidTest/java']
          }


        }

 }

good luck


Solution 2:

You have to specify the app to be tested in the AndroidManifest of the testing project.. that might be missing.


Solution 3:

I had a similar issue, and I tracked the problem down to my gradle file. I needed the following in there:

aidl.srcDirs = ['src']

Post a Comment for "Could Not Be Found Or Has No Tests In Junit"