Skip to content
This repository has been archived by the owner on Apr 19, 2018. It is now read-only.

NPE #412

Open
4ntoine opened this issue Aug 19, 2016 · 7 comments
Open

NPE #412

4ntoine opened this issue Aug 19, 2016 · 7 comments

Comments

@4ntoine
Copy link

4ntoine commented Aug 19, 2016

Got NPE reported by crashlytics:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.VelocityTracker.computeCurrentVelocity(int, float)' on a null object reference
       at android.support.v4.view.ViewPager.endFakeDrag(ViewPager.java:2395)
       at com.viewpagerindicator.TitlePageIndicator.onTouchEvent(TitlePageIndicator.java:615)
       at android.view.View.dispatchTouchEvent(View.java:9993)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2799)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2799)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2799)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2799)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2799)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2799)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2799)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2799)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2799)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
       at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2831)
       at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1863)
       at android.app.Activity.dispatchTouchEvent(Activity.java:3046)
       at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60)
       at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60)
       at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2792)
       at android.view.View.dispatchPointerEvent(View.java:10228)
       at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5344)
       at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5180)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4620)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4673)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4639)
       at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4781)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4647)
       at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4838)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4620)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4673)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4639)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4647)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4620)
       at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7306)
       at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7184)
       at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7145)
       at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7416)
       at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:323)
       at android.os.Looper.loop(Looper.java:143)
       at android.app.ActivityThread.main(ActivityThread.java:7224)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
@rakeshcusat
Copy link

rakeshcusat commented Oct 17, 2016

Even my Crashlytics account reported similar problem. I stated noticing this exception a lot lately.

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.VelocityTracker.addMovement(android.view.MotionEvent)' on a null object reference
       at android.support.v4.view.ViewPager.fakeDragBy(SourceFile:2542)
       at com.viewpagerindicator.CirclePageIndicator.onTouchEvent(SourceFile:310)
       at android.view.View.dispatchTouchEvent(View.java:9998)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2871)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
       at android.widget.ScrollView.dispatchTouchEvent(ScrollView.java:645)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
       at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2816)
       at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1848)
       at android.app.Activity.dispatchTouchEvent(Activity.java:3046)
       at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(SourceFile:60)
       at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2777)
       at android.view.View.dispatchPointerEvent(View.java:10233)
       at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5397)
       at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5233)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4673)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4726)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4692)
       at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4834)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4700)
       at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4891)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4673)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4726)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4692)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4700)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4673)
       at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7359)
       at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7237)
       at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7198)
       at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7469)
       at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:323)
       at android.os.Looper.loop(Looper.java:143)
       at android.app.ActivityThread.main(ActivityThread.java:7229)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

Is there any plan to fix this issue soon because it is affecting a lot of people in production. If we this issue is not fixed recently then I have to replace this component with something else.

@captain-miao
Copy link

+1

@hexi
Copy link

hexi commented Mar 17, 2017

I have this issue. Any solution?

@devlinsmith
Copy link

+1
gradle has:
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.mcxiaoke.viewpagerindicator:library:2.4.1@aar'

but I've also found we can now:
compile 'com.github.JakeWharton:ViewPagerIndicator:2.4.1'

Which has min sdk 11 requirement unless you force, which I think may give some issues. For me (need API 9)

Don't understand the full issue, but there is some compatibility thing going on here.

@devlinsmith
Copy link

devlinsmith commented Mar 28, 2017

Custom solution, if you aren't worried about the indicators being touchable:
extend CirclePageIndicator
@OverRide
public boolean onTouchEvent(MotionEvent ev) {
return true;
}

@natronite
Copy link

We do have the same issue in our apps. What's the status on this?

@lennonpetrick
Copy link

I am having the same issue. Did anybody fix this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants