could not be found or has no tests in Junit
Asked Answered
L

3

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

Lymphadenitis answered 28/2, 2012 at 5:41 Comment(2)
Post your test class code will help others find your problem.Scansorial
A similar problem and another solution is also posted in [this question][1]. [1]: #2347234Response
B
0

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

Blouson answered 28/2, 2012 at 5:43 Comment(2)
yes , I have specified it.Setting app is having shared userId is that a problem?Lymphadenitis
@VIJESH What do you mean your app has a "shared userId"? Where did you specify that?Trina
Z
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

Zymolysis answered 4/10, 2017 at 4:23 Comment(0)
B
0

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

Blouson answered 28/2, 2012 at 5:43 Comment(2)
yes , I have specified it.Setting app is having shared userId is that a problem?Lymphadenitis
@VIJESH What do you mean your app has a "shared userId"? Where did you specify that?Trina
T
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']
Trina answered 9/4, 2014 at 16:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.