0

テストを実行しようとすると、次のエラーが発生します。また、いくつかのサンプルをロードしてテストしようとしましたが、同じエラーが発生します。

これは、ここにあるチュートリアルに従って生成されます

助けてくれてありがとう

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)
4

2 に答える 2

1

テストクラスのコンストラクターに次のコードがある可能性があります。

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

このコードの代わりに:

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

私はちょうど同様の問題に遭遇しました、そしてそれはそれが解決策でした。

于 2010-10-04T14:08:02.537 に答える
0

SDKが正しく設定されていない可能性がありますか?Android SDK を再インストールしてみてください ( http://developer.android.com/sdk/index.html )

于 2010-05-26T14:27:14.057 に答える