java.lang.NoClassDefFoundError: com.nineoldandroids.view.ViewHelper

Devendra Singh picture Devendra Singh · Apr 27, 2015 · Viewed 7k times · Source

I am using daimajia/AndroidImageSlider. I imported all dependencies like NineOldAndroid,Picasso and this 'com.daimajia.slider:library:1.1.2@aar' and coded as guided on Github. but whenever i tried to run the app it stops and show the error.my biuld.gradle for app is.Thank you so much. spent two days already.

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.1.0'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.daimajia.slider:library:1.1.2@aar'
compile 'com.android.support:recyclerview-v7:21.0.+'
compile files('C:/Users/Vinit/Downloads/Coupan/library/volley.jar')
compile files('C:/Users/Vinit/Downloads/Coupan/library/nineoldandroids-2.3.0.jar')}

Don't know where and what i am doing wrong. this is my log file.

java.lang.NoClassDefFoundError: com.nineoldandroids.view.ViewHelper
        at com.daimajia.slider.library.Transformers.BaseTransformer.onPreTransform(BaseTransformer.java:75)
        at com.daimajia.slider.library.Transformers.BaseTransformer.transformPage(BaseTransformer.java:42)
        at com.daimajia.slider.library.Tricks.ViewPagerEx.onPageScrolled(ViewPagerEx.java:1727)
        at com.daimajia.slider.library.Tricks.ViewPagerEx.pageScrolled(ViewPagerEx.java:1649)
        at com.daimajia.slider.library.Tricks.ViewPagerEx.scrollToItem(ViewPagerEx.java:581)
        at com.daimajia.slider.library.Tricks.ViewPagerEx.onLayout(ViewPagerEx.java:1599)
        at android.view.View.layout(View.java:15131)
        at android.view.ViewGroup.layout(ViewGroup.java:4862)
        at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1160)
        at android.view.View.layout(View.java:15131)
        at android.view.ViewGroup.layout(ViewGroup.java:4862)
        at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1160)
        at android.view.View.layout(View.java:15131)
        at android.view.ViewGroup.layout(ViewGroup.java:4862)
        at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1160)
        at android.view.View.layout(View.java:15131)
        at android.view.ViewGroup.layout(ViewGroup.java:4862)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:515)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:450)
        at android.view.View.layout(View.java:15131)
        at android.view.ViewGroup.layout(ViewGroup.java:4862)
        at android.support.v7.internal.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:493)
        at android.view.View.layout(View.java:15131)
        at android.view.ViewGroup.layout(ViewGroup.java:4862)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:515)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:450)
        at android.view.View.layout(View.java:15131)
        at android.view.ViewGroup.layout(ViewGroup.java:4862)
        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1888)
        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1742)
        at android.widget.LinearLayout.onLayout(LinearLayout.java:1651)
        at android.view.View.layout(View.java:15131)
        at android.view.ViewGroup.layout(ViewGroup.java:4862)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:515)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:450)
        at android.view.View.layout(View.java:15131)
        at android.view.ViewGroup.layout(ViewGroup.java:4862)
        at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2323)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2029)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1192)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6231)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:788)
        at android.view.Choreographer.doCallbacks(Choreographer.java:591)
        at android.view.Choreographer.doFrame(Choreographer.java:560)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:774)
        at android.os.Handler.handleCallback(Handler.java:808)
        at android.os.Handler.dispatchMessage(Handler.java:103)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:5292)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
        at dalvik.system.NativeStart.main(Native Method)

Answer

Devendra Singh picture Devendra Singh · Apr 27, 2015

Finally, after two days I found the solution. I just added:

implementation 'com.nineoldandroids:library:2.4.0'