[英]java.lang.NoClassDefFoundError when running Android JUnit test
I've three projects in workspace: Common, Client and Server . 我在工作区中有三个项目: Common,Client和Server 。
Common: The classes are used in both Client and Server project. 通用:这些类在Client和Server项目中都使用。
Now, Common project contains a Class User 现在,Common项目包含一个Class User
However when I run the Client-test, it gives me 但是,当我运行客户端测试时,它给了我
java.lang.NoClassDefFoundError: com.org.example.common.model.User
Please Note: 请注意:
UPDATE: It also gives me the same error when I create the User object in Client project. 更新:当我在Client项目中创建User对象时,它也给我同样的错误。
Got it. 得到它了。
The problem was that Android dependencies in my Client project were not being updated. 问题是我的Client项目中的Android依赖项没有更新。 This prevented classes from being added to build path.
这样可以防止将类添加到构建路径。
Steps to solve the issue: 解决问题的步骤:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.