Error running helloworldtest from the tutorial

By : paul
Source: Stackoverflow.com
Question!

I'm getting the following error whenever I try to run a test. I have also tried to load some of the samples and test them, but I get the same error.

This is generated following the tutorials found here

Thanks for any help

java.lang.RuntimeException: Unable to resolve activity for: Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=ca.imt.helloandroid.HelloAndroid/ca.imt.helloandroid.HelloAndroid }
at android.app.Instrumentation.startActivitySync(Instrumentation.java:371)
at android.test.InstrumentationTestCase.launchActivityWithIntent(InstrumentationTestCase.java:120)
at android.test.InstrumentationTestCase.launchActivity(InstrumentationTestCase.java:98)
at android.test.ActivityInstrumentationTestCase2.getActivity(ActivityInstrumentationTestCase2.java:87)
at ca.imt.helloandroid.test.HelloAndroidTest.setUp(HelloAndroidTest.java:24)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:430)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)
By : paul


Answers

Maybe the SDK ins't set up properly? try re-installing the Android SDK (http://developer.android.com/sdk/index.html)

By : Maj. Fail


Could it be that in your test class' constructor you have the following code:

public HelloAndroidTest() {
    super("com.example.helloandroid.HelloAndroid", HelloAndroid.class);
}

instead of this code:

public HelloAndroidTest() {
    super("com.example.helloandroid", HelloAndroid.class);
}

?

I just ran into a similar issue, and that was it's solution.



This video can help you solving your question :)
By: admin