java.lang.NoClassDefFoundError的,而在Netbeans的运行JUnit测试 [英] java.lang.NoClassDefFoundError while running JUnit test in Netbeans

查看:150
本文介绍了java.lang.NoClassDefFoundError的,而在Netbeans的运行JUnit测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立在Netbeans的一个Android Hello World应用程序。它建立正常,我能够在模拟器中运行也。

I am building an Android hello world application in Netbeans. It's building properly and I am able to run in the emulator also.

但创建和运行JUnit测试时,我得到一个 java.lang.NoClassDefFoundError的

But when creating and running the Junit test I get a java.lang.NoClassDefFoundError.

我怎样才能解决这个问题呢?

How can I fix this problem?

推荐答案

检查您的测试项目清单,例如 HelloWorldTest / AndroidManifest.xml中。该安卓targetPackage 仪器仪表标记应针对包在你的应用程序,例如属性, com.example.helloworld 的测试包的测试项目(如 com.example.helloworld.test )。

Check the manifest of your test project, for example HelloWorldTest/AndroidManifest.xml. The android:targetPackage attribute of the instrumentation markup should target the package in your application, for example, com.example.helloworld. Not the test package of your test project (eg. com.example.helloworld.test).

这篇关于java.lang.NoClassDefFoundError的,而在Netbeans的运行JUnit测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆