java.lang.IllegalAccessError:类文献在pre-核实级解决意外的得到执行,同时运行测试项目?文献、意外、测试、项目

2023-09-12 22:32:01 作者:发粪涂墙.

我已使用第三方库(zxing)之后实施的项目是工作的罚款我已经写再经过一个测试项目进行单元测试我project.After运行测试工程,主体工程,类和它的方法是实施项目不给任何错误,但如果有zxing框架类的主要项目有收到上述错误在运行时没有对这种方法在utilyzed编译time.Please告诉我如何解决这个问题?

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.

仅供参考, 点击这里查看详细的解释。