Testing Android with Eclipse throws NoClassDefFoundError for MyActivity -


Whenever I start my own separate Android Test project through the 'Android Junit Test', I always get:

  test run failed: Unable to get instrumentation information: ComponentInfo {my.pack / android.test.InstrumentationTestRunner}   

This Android manifest XML was solved by touching (funny !!)

But now when I try to execute this test:

  increases the public class MyActivityTest ActivityInstrumentationTestCase2 & Lt; MyActivity & gt; {Public MyActivityTest (//) Here it fails with the Noacalla Defound Error for MyActivity Super ("My.", MyActivity.class); } Public void testGetChangedTweetIds () {// Some tests are here}}   

I am getting:

  java.lang.RuntimeException: during suite creation exceptions at android.test.suitebuilder.TestSuiteBuilder $ FailedToCreateTests.testSuiteConstructionAfter (testSuiteBuilder.java Jun 3 9) Android on java.lang.reflect.Method.invoke native (native Method) at Android. met. On Testrnrkrn Test (AndroidTestRunner.java:169) Android Java: .test.AndroidTestRunner.runTest (AndroidTestRunner.java:154) on android.test.InstrumentationTestRunner.onStart android.app.Instrumentation $ InstrumentationThread.run (InstrumentationTestRunner.java: 520) (Instrumentation.java:1447) due to the above. Lang.reflect.InvocationTargetException on my.pack.MyActivityTest & Lt; Init & gt; JavaklangkreflectkConstructorkconstructNative (Native Method) at JavaklangkreflectkConstructorknewInstance (MyActivityTestkjava:l3) (manufacturer. Java: 446) android.test.suitebuilder.TestMethod.instantiateTest on ( TestMethod.java:87) .suitebuilder.TestMethod.createTest on android.test (TestMethod.java:73) android.test.suitebuilder.TestSuiteBuilder.addTest (TestSuiteBuilder.java:263) android.test.suitebuilder.TestSuiteBuilder.build (TestSuiteBuilder .java: 185) on but on Android. In test.InstrumentationTestRunner.onCreate (InstrumentationTestRunner.java:373) android.app.ActivityThread.handleBindApplication (ActivityThread.java:4218) android.app.ActivityThread.access $ 3000 (ActivityThread.java:125) at least android.app .ActivityThread $ H.handleMessage (ActivityThread.java:2071) android.os.Handler.dispatchMessage (Handler.java:99) android.os.Looper.loop (Looper.java:123) android.app.ActivityThread.main on at at (ActivityThread Java: 4627) java.lang.reflect.Method.invokeNative (natives on com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java:868) on com.android.internal.os.ZygoteInit Method) on the Dalvi system NetStart.main (native method): java.lang.NoClassDefFoundError: my.pack.MyActivity ... 19 .main (zigoteinit.java: 626) ... more   

although I The main project of the construction project (Eclipse Conjugation) has been added.

Why are the eclipse problems from the recommended perspective of a separate test project?

"post-text" itemprop = "text">
  1. Your FIR problem indicates that the device is not available, the list of available resources

    $ ADB Shell Telemetal Instrumentation

  2. The API has been removed since the level 8

  3. There is a problem with your Eclipse installation.

    Tested from the command line with $ ADB shell [flag]

Comments