3

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?.

Code Lღver
  • 15,573
  • 16
  • 56
  • 75
V I J E S H
  • 93
  • 1
  • 6
  • Post your test class code will help others find your problem. – yorkw Feb 28 '12 at 08:27
  • A similar problem and another solution is also posted in [this question][1]. [1]: http://stackoverflow.com/questions/2346734/trying-to-run-android-junit-tests-in-eclipse-fails/10024250 – Stan Sidel Apr 05 '12 at 07:29

3 Answers3

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

Imeshke
  • 811
  • 6
  • 13
0

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

aidl.srcDirs = ['src']
IgorGanapolsky
  • 26,189
  • 23
  • 116
  • 147
0

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

Manfred Moser
  • 29,539
  • 13
  • 92
  • 123