您好Android测试错误

时间:2011-01-04 07:04:42

标签: android

嗨,当我运行hello Android test http://developer.android.com/resources/tutorials/testing/helloandroid_test.html

我收到以下错误

java.lang.RuntimeException: Unable to resolve activity for: Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.example.helloandroid/com.ex.helloAndroid.HelloAndroid }
at android.app.Instrumentation.startActivitySync(Instrumentation.java:447)
at android.test.InstrumentationTestCase.launchActivityWithIntent(InstrumentationTestCase.java:106)
at android.test.InstrumentationTestCase.launchActivity(InstrumentationTestCase.java:84)
at android.test.ActivityInstrumentationTestCase2.getActivity(ActivityInstrumentationTestCase2.java:87)
at com.example.helloandroid.test.HelloAndroidTest.setUp(HelloAndroidTest.java:19)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:164)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:151)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:425)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1520)

我不明白为什么会出现这些错误并给我一些建议。谢谢提前

1 个答案:

答案 0 :(得分:1)

我猜你没有在AndroidManifest.xml文件中指定活动名称

<activity android:name=".ClassName"
        android:label="@string/app_name">
    </activity>

像上面提到的代码。

希望它有所帮助!!