java.lang.IllegalAccessError:预验证类中的类引用在运行测试项目时解析为意外实现? [英] java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation getting while running test project?

查看:28
本文介绍了java.lang.IllegalAccessError:预验证类中的类引用在运行测试项目时解析为意外实现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用第三方库(zxing)实现了项目,在实现项目工作正常之后,我写了一个测试项目来对我的项目进行单元测试.运行测试项目后,主项目、类和它的方法是没有给出任何错误,但如果在主项目的该方法中使用了任何 zxing 框架类,则在运行时尚未编译时出现上述错误.请告诉我如何解决此问题?

I have implemented project by using third party library(zxing) after implementation project is working fine then after I have written one test project to unit test my project.After running the test project ,the main project ,classes and it's methods are not giving any errors but if any zxing framework class is utilyzed within that method of the main project there getting the above error at run time not yet compile time.Please tell me how to resolve this issue?

推荐答案

您收到此错误是因为添加了两次第三方库引用.您已经在测试项目的构建路径中添加了应用程序路径.所以库引用会自动添加到测试项目中".在属性->android 下删除测试项目中的任何库引用.

You are getting this error because of third party library reference added two times. You have added the application path in the build path of test project. so the library reference automatically added to test project". Remove any library reference in the test project under properties->android.

仅供参考,点击此处查看详细说明.

这篇关于java.lang.IllegalAccessError:预验证类中的类引用在运行测试项目时解析为意外实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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