Skip to content
This repository has been archived by the owner on Apr 19, 2018. It is now read-only.

NoClassDefFoundError when using BetterPicker's CalendarDatePickerDialog #71

Open
mousewithjetpack opened this issue Jun 14, 2014 · 0 comments

Comments

@mousewithjetpack
Copy link

When running BetterPicker's CalendarDatePickerDialog on Android 3.0, I get a NoClassDefFoundError for AccessibilityNodeInfo.

Here is the relevant part of the LogCat:

06-14 03:37:09.133      397-397/com.testapp E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.NoClassDefFoundError: android.view.accessibility.AccessibilityNodeInfo
            at java.lang.Class.getDeclaredMethods(Native Method)
            at java.lang.ClassCache.getDeclaredPublicMethods(ClassCache.java:153)
            at java.lang.ClassCache.getMethodsRecursive(ClassCache.java:216)
            at java.lang.ClassCache.findMethods(ClassCache.java:175)
            at java.lang.ClassCache.getMethods(ClassCache.java:167)
            at java.lang.Class.getMethod(Class.java:976)
            at com.nineoldandroids.animation.PropertyValuesHolder.getPropertyFunction(PropertyValuesHolder.java:415)
            at com.nineoldandroids.animation.PropertyValuesHolder.setupSetterOrGetter(PropertyValuesHolder.java:468)
            at com.nineoldandroids.animation.PropertyValuesHolder.setupSetter(PropertyValuesHolder.java:486)
            at com.nineoldandroids.animation.PropertyValuesHolder$FloatPropertyValuesHolder.setupSetter(PropertyValuesHolder.java:1020)
            at com.nineoldandroids.animation.PropertyValuesHolder.setupSetterAndGetter(PropertyValuesHolder.java:525)
            at com.nineoldandroids.animation.ObjectAnimator.initAnimation(ObjectAnimator.java:410)
            at com.nineoldandroids.animation.ValueAnimator.startAnimation(ValueAnimator.java:1046)
            at com.nineoldandroids.animation.ValueAnimator.access$400(ValueAnimator.java:43)
            at com.nineoldandroids.animation.ValueAnimator$AnimationHandler.handleMessage(ValueAnimator.java:637)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:126)
            at android.app.ActivityThread.main(ActivityThread.java:3997)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:491)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.ClassNotFoundException: android.view.accessibility.AccessibilityNodeInfo in loader dalvik.system.PathClassLoader[/data/app/com.testapp-2.apk]
            at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:251)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:548)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:508)
            at java.lang.Class.getDeclaredMethods(Native Method)
            at java.lang.ClassCache.getDeclaredPublicMethods(ClassCache.java:153)
            at java.lang.ClassCache.getMethodsRecursive(ClassCache.java:216)
            at java.lang.ClassCache.findMethods(ClassCache.java:175)
            at java.lang.ClassCache.getMethods(ClassCache.java:167)
            at java.lang.Class.getMethod(Class.java:976)
            at com.nineoldandroids.animation.PropertyValuesHolder.getPropertyFunction(PropertyValuesHolder.java:415)
            at com.nineoldandroids.animation.PropertyValuesHolder.setupSetterOrGetter(PropertyValuesHolder.java:468)
            at com.nineoldandroids.animation.PropertyValuesHolder.setupSetter(PropertyValuesHolder.java:486)
            at com.nineoldandroids.animation.PropertyValuesHolder$FloatPropertyValuesHolder.setupSetter(PropertyValuesHolder.java:1020)
            at com.nineoldandroids.animation.PropertyValuesHolder.setupSetterAndGetter(PropertyValuesHolder.java:525)
            at com.nineoldandroids.animation.ObjectAnimator.initAnimation(ObjectAnimator.java:410)
            at com.nineoldandroids.animation.ValueAnimator.startAnimation(ValueAnimator.java:1046)
            at com.nineoldandroids.animation.ValueAnimator.access$400(ValueAnimator.java:43)
            at com.nineoldandroids.animation.ValueAnimator$AnimationHandler.handleMessage(ValueAnimator.java:637)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:126)
            at android.app.ActivityThread.main(ActivityThread.java:3997)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:491)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
            at dalvik.system.NativeStart.main(Native Method)

I looked at this line in your code:

com.nineoldandroids.animation.PropertyValuesHolder.getPropertyFunction(PropertyValuesHolder.java:415)

and I added a new catch block that catches the NoClassDefFoundError that line 415 throws, and just swallow the exception, and then the CalendarDatePickerDialog works on Android 3.0.

Not sure if this is something you want to look into, but I thought I would let you know.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant