开发者

Error running helloworldtest from the tutorial

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开发者_JAVA百科)
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)


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜