hanks-zyh / SmallBang

twitter like animation for any view :heartbeat:
Apache License 2.0
1k stars 158 forks source link

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setScaleX(float)' on a null object reference #13

Open dipeshjethva opened 6 years ago

dipeshjethva commented 6 years ago

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setScaleX(float)' on a null object reference at xyz.hanks.library.bang.SmallBangView.likeAnimation(SmallBangView.java:190) at com.yourpackagename.CatJobActivity$JobListFragment$JobListingAdapter.onBindViewHolder(CatJobActivity.java:915) at com.yourpackagename.CatJobActivity$JobListFragment$JobListingAdapter.onBindViewHolder(CatJobActivity.java:867) at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6356) at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6389) at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5335) at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5598) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5440) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5436) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2224) at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1551) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1511) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:595) at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3583) at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3312) at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3844) at android.view.View.layout(View.java:19055) at android.view.ViewGroup.layout(ViewGroup.java:5935) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079) at android.view.View.layout(View.java:19055) at android.view.ViewGroup.layout(ViewGroup.java:5935) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585) at android.widget.LinearLayout.onLayout(LinearLayout.java:1494) at android.view.View.layout(View.java:19055) at android.view.ViewGroup.layout(ViewGroup.java:5935) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585) at android.widget.LinearLayout.onLayout(LinearLayout.java:1494) at android.view.View.layout(View.java:19055) at android.view.ViewGroup.layout(ViewGroup.java:5935) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079) at android.view.View.layout(View.java:19055) at android.view.ViewGroup.layout(ViewGroup.java:5935) at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:131) at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:42) at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1391) at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:870) at android.view.View.layout(View.java:19055) at android.view.ViewGroup.layout(ViewGroup.java:5935) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:19055) at android.view.ViewGroup.layout(ViewGroup.java:5935) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585) at android.widget.LinearLayout.onLayout(LinearLayout.java:1494) at android.view.View.layout(View.java:19055) at android.view.ViewGroup.layout(ViewGroup.java:5935) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079) at android.view.View.layout(View.java:19055) at android.view.ViewGroup.layout(ViewGroup.java:5935) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079) at android.view.View.layout(View.java:19055) at android.view.ViewGroup.layout(ViewGroup.java:5935) at android.support.design.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.java:1167) at android.support.design.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.java:852) at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:871) at android.view.View.layout(View.java:19055) at android.view.ViewGroup.layout(ViewGroup.java:5935) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:19055) at android.view.ViewGroup.layout(ViewGroup.java:5935) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585) at android.widget.LinearLayout.onLayout(LinearLayout.java:1494) at android.view.View.layout(View.java:19055) at android.view.ViewGroup.layout(ViewGroup.java:5935) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:19055) at android.view.ViewGroup.layout(ViewGroup.java:5935) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585) at android.widget.LinearLayout.onLayout(LinearLayout.java:1494) at android.view.View.layout(View.java:19055) at android.view.ViewGroup.layout(ViewGroup.java:5935) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at com.android.internal.policy.DecorView.onLayout(DecorView.java:954) at android.view.View.layout(View.java:19055) at android.view.ViewGroup.layout(ViewGroup.java:5935) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2716) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2431) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1569) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7301) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:930) at android.view.Choreographer.doCallbacks(Choreographer.java:705) at android.view.Choreographer.doFrame(Choreographer.java:640) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:916) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6816) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)

aliusman commented 3 years ago

I had the same issue - SmallBangView must be rendered on runtime fixed it for me.