daimajia / AndroidViewAnimations

Cute view animation collection.
MIT License
12.43k stars 2.42k forks source link

Null pointer exception (Set Alpha) #89

Closed dhruvalpatel18 closed 7 years ago

dhruvalpatel18 commented 7 years ago

I am using your library in my app and I am getting following error.

 java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setAlpha(float)' on a null object reference
                      at com.nineoldandroids.view.ViewHelper$Honeycomb.setAlpha(ViewHelper.java:185)
                      at com.nineoldandroids.view.ViewHelper.setAlpha(ViewHelper.java:19)
                      at com.daimajia.androidanimations.library.BaseViewAnimator.reset(BaseViewAnimator.java:60)
                      at com.daimajia.androidanimations.library.BaseViewAnimator.animate(BaseViewAnimator.java:49)
                      at com.daimajia.androidanimations.library.YoYo.play(YoYo.java:152)
                      at com.daimajia.androidanimations.library.YoYo.access$900(YoYo.java:36)
                      at com.daimajia.androidanimations.library.YoYo$AnimationComposer.playOn(YoYo.java:106)
                      at com.handm.dhruval.earthquakenews.ui.MainActivity$2.onDrawerOpened(MainActivity.java:109)
                      at android.support.v4.widget.DrawerLayout.dispatchOnDrawerOpened(DrawerLayout.java:875)
                      at android.support.v4.widget.DrawerLayout.updateDrawerState(DrawerLayout.java:820)
                      at android.support.v4.widget.DrawerLayout$ViewDragCallback.onViewDragStateChanged(DrawerLayout.java:2085)
                      at android.support.v4.widget.ViewDragHelper.setDragState(ViewDragHelper.java:881)
                      at android.support.v4.widget.ViewDragHelper$2.run(ViewDragHelper.java:338)
                      at android.os.Handler.handleCallback(Handler.java:739)
                      at android.os.Handler.dispatchMessage(Handler.java:95)
                      at android.os.Looper.loop(Looper.java:148)
                      at android.app.ActivityThread.main(ActivityThread.java:5417)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
daimajia commented 7 years ago

Hey, please paste your code here. I guess you are passing a null object.