Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/185.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android junit测试中的错误_Android_Junit - Fatal编程技术网

Android junit测试中的错误

Android junit测试中的错误,android,junit,Android,Junit,提前感谢您的帮助。我完全被此错误困扰,请帮助我。尝试添加另一个构造函数: junit.framework.AssertionFailedError: Class com.android.deviceintelligence.test.Testshutdown has no public constructor TestCase(String name) or TestCase() at android.test.AndroidTestRunner.runTest(AndroidTestRunne

提前感谢您的帮助。我完全被此错误困扰,请帮助我。

尝试添加另一个构造函数:

junit.framework.AssertionFailedError: Class com.android.deviceintelligence.test.Testshutdown has no public constructor TestCase(String name) or TestCase()
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:1448)

如果Testshutdown扩展了ActivityInstrumentationTestCase2
您必须设置一个公共默认构造函数并在super(Testshutdown.class)中调用。

第一行说
Testshutdown没有公共构造函数TestCase(字符串名)或TestCase()
。请检查一下。请提供您的整个崩溃日志、代码和问题的详细描述,没有这些,没有人能给您带来多大帮助。我在代码中又发布了一个问题,请解决它。到您的问题伙伴的链接在哪里?
public Testshutdown() {
        super("", YourActivity.class);
}