Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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)
like image 833
Devendra Singh Avatar asked Apr 27 '15 10:04

Devendra Singh


3 Answers

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

implementation 'com.nineoldandroids:library:2.4.0'

like image 160
Devendra Singh Avatar answered Oct 13 '22 14:10

Devendra Singh


Move all your libraries in lib folder under your app folder in android studio and then add its path in build.gradle dependencies.

for ex-

compile files('lib/volley.jar')
like image 20
Sajal Avatar answered Oct 13 '22 13:10

Sajal


NineOldAndroids is deprecated. No new development will be taking place. Existing versions will (of course) continue to function. New applications should use minSdkVersion="14" or higher which has access to the platform animation APIs.

like image 35
Shoaib Khan Avatar answered Oct 13 '22 14:10

Shoaib Khan