IllegalAccessError: ref class in pre-checked class resolved to unexpected implementation
When I run my Android app I run into 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?
+2
source to share
2 answers
I just hit and solved this problem - you need to add all dependencies in android project pom.xml to your scoped pom.xml test projects as stated
for this bug report: http://code.google.com/p/maven-android-plugin/issues/detail?id=142
eg.
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
<scope>provided</scope>
</dependency>
+4
source to share