本文介绍了IllegalAccessError:类文献在pre-核实级解决意外的执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我运行我的Android应用程序,我会遇到这样的的NoClassDefFoundError
:
When I run my Android application, I encounter this NoClassDefFoundError
:
03-13 18:06:38.648: E/AndroidRuntime(413): Uncaught handler: thread main exiting due to uncaught exception
03-13 18:06:38.688: E/AndroidRuntime(413): java.lang.NoClassDefFoundError: com.InternetGMBH.ThousandPS.Activities.DealerDetailsDisplay
03-13 18:06:38.688: E/AndroidRuntime(413): at com.InternetGMBH.ThousandPS.Activities.DealerListAdapter$1.onClick(DealerListAdapter.java:76)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.view.View.performClick(View.java:2364)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.view.View.onTouchEvent(View.java:4179)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.widget.TextView.onTouchEvent(TextView.java:6540)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.view.View.dispatchTouchEvent(View.java:3709)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
03-13 18:06:38.688: E/AndroidRuntime(413): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
03-13 18:06:38.688: E/AndroidRuntime(413): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
03-13 18:06:38.688: E/AndroidRuntime(413): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
03-13 18:06:38.688: E/AndroidRuntime(413): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
03-13 18:06:38.688: E/AndroidRuntime(413): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
03-13 18:06:38.688: E/AndroidRuntime(413): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
03-13 18:06:38.688: E/AndroidRuntime(413): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
03-13 18:06:38.688: E/AndroidRuntime(413): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
03-13 18:06:38.688: E/AndroidRuntime(413): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.os.Handler.dispatchMessage(Handler.java:99)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.os.Looper.loop(Looper.java:123)
03-13 18:06:38.688: E/AndroidRuntime(413): at android.app.ActivityThread.main(ActivityThread.java:4363)
03-13 18:06:38.688: E/AndroidRuntime(413): at java.lang.reflect.Method.invokeNative(Native Method)
03-13 18:06:38.688: E/AndroidRuntime(413): at java.lang.reflect.Method.invoke(Method.java:521)
03-13 18:06:38.688: E/AndroidRuntime(413): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
03-13 18:06:38.688: E/AndroidRuntime(413): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
03-13 18:06:38.688: E/AndroidRuntime(413): at dalvik.system.NativeStart.main(Native Method)
03-13 18:06:38.688: E/AndroidRuntime(413): Caused by: java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
03-13 18:06:38.688: E/AndroidRuntime(413): at dalvik.system.DexFile.defineClass(Native Method)
03-13 18:06:38.688: E/AndroidRuntime(413): at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:209)
03-13 18:06:38.688: E/AndroidRuntime(413): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:203)
03-13 18:06:38.688: E/AndroidRuntime(413): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
03-13 18:06:38.688: E/AndroidRuntime(413): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
如何解决这个问题呢?
How to solve this problem?
推荐答案
我只是打了解决了这个问题 - 你需要在你的Android项目的pom.xml添加所有依赖于您的测试项目中的pom.xml用范围所提供的
I just hit and solved this issue - you need to add all of the dependencies in your android project's pom.xml to your test projects pom.xml with a scope as provided
根据该错误报告: HTTP://$c$c.google .COM / P / Maven的Android的插件/问题/详细信息?ID = 142
例如。
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
<scope>provided</scope>
</dependency>
这篇关于IllegalAccessError:类文献在pre-核实级解决意外的执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!