我正在使用daimajia/AndroidImageSlider。我导入了所有依赖项,如nineoldandroid、picasso和这个“com.daimajia.slider:library:1.1.2@aar”,并按照github上的指导进行编码。但每当我尝试运行这个应用程序时,它就会停止运行并显示错误。我的biuld.gradle for app是。非常感谢。已经花了两天了。
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')}
不知道我做错了什么。这是我的日志文件。
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)
最佳答案
两天后,我终于找到了解决办法。我刚刚补充道:compile 'com.nineoldandroids:library:2.4.0'