Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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: WARN/TestGrouping(2942): Invalid Package: '' could not be found or has no tests 01-12 17:22:11.539:

INFO/ActivityManager(1620): Force stopping package com.android.settings uid=1000

Can any one suggest a solution for this?.

like image 670
V I J E S H Avatar asked Jan 25 '26 13:01

V I J E S H


1 Answers

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

like image 152
Imeshke Avatar answered Jan 28 '26 05:01

Imeshke