2011-03-29 3 views
3

이제 튜토리얼을 완료하고 testApplication에서 이러한 유형의 오류를 발견했습니다. 어떻게해야합니까? 간단한 HeloAndroidTest 응용 프로그램입니다.시험용 안드로이드 응용 프로그램 오류

오류는 당신이 당신의 HelloAndroidTest.java 파일을 공유 할 수

java.lang.RuntimeException: Exception during suite construction 
at android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests.testSuiteConstructionFailed(TestSuiteBuilder.java:239) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169) 
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154) 
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:529) 
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447) 
Caused by: java.lang.reflect.InvocationTargetException 
at java.lang.reflect.Constructor.constructNative(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:415) 
at android.test.suitebuilder.TestMethod.instantiateTest(TestMethod.java:87) 
at android.test.suitebuilder.TestMethod.createTest(TestMethod.java:73) 
at android.test.suitebuilder.TestSuiteBuilder.addTest(TestSuiteBuilder.java:263) 
at android.test.suitebuilder.TestSuiteBuilder.build(TestSuiteBuilder.java:185) 
at android.test.InstrumentationTestRunner.onCreate(InstrumentationTestRunner.java:373) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3210) 
at android.app.ActivityThread.access$2200(ActivityThread.java:117) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:966) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:123) 
at android.app.ActivityThread.main(ActivityThread.java:3647) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 
at dalvik.system.NativeStart.main(Native Method) 
Caused by: java.lang.NoClassDefFoundError: com.example.helloandroid.HelloAndroid 
at com.example.helloandroid.test.HelloAndroidTest.<init>(HelloAndroidTest.java:13) 
... 18 more 
+0

Yikes !!! 3 가지가 아니라 한 번에 하나의 언어 만 사용하십시오! – pmg

답변

0

입니까? 아마도 Activity를 Manifest.xml 파일에 추가하는 것을 잊었거나 틀린 레이아웃을 사용하는 것을 잊었을 것입니다.

+0

http://developer.android.com/resources/tutorials/testing/helloandroid_test.html –

+0

오류는 "super ("com.example.helloandroid ", HelloAndroid.class);"줄에 있으므로 가능한 두 가지가 있습니다 이유 : 1) HelloAndroid.class 클래스의 이름이 잘못되었거나 2) com.example.helloadroid에 대한 잘못된 참조. 확인해주세요. –

+0

Mr.Anton Derevyanko –

3

안녕하세요.

super("com.example.helloandroid", HelloAndroid.class) 

은 더 이상 사용되지 않습니다.

public MyTest() { 
     super(MyActivity.class); 
    } 

이 오류의 원인과 치료이다 : 당신은 thusly 히 슈퍼에의 활동을 통과 테스트에서 노 인수의 생성자이 필요합니다.

관련 문제