ronaldsmartin / Material-ViewPagerIndicator

Dot-based Android ViewPager indicator with Material Design animations.
http://itsronald.com/blog/2016/10/my-first-library/
Apache License 2.0
520 stars 76 forks source link

Crash on Android 9.0 #32

Open ergindogan opened 6 years ago

ergindogan commented 6 years ago

Hi there,

Great library. I wasn't having any issues with the library until I updated targetSdkVersion to 28 and starting experiencing crashes. I am not quite sure the issue is related to that but that is the only change I made. Here is the crash log.

java.lang.IllegalArgumentException: Cannot set 'scaleX' to Float.NaN at android.view.View.sanitizeFloatPropertyValue(View.java:15425) at android.view.View.sanitizeFloatPropertyValue(View.java:15399) at android.view.View.setScaleX(View.java:14788) at android.view.View$12.setValue(View.java:25650) at android.view.View$12.setValue(View.java:25647) at android.animation.PropertyValuesHolder$FloatPropertyValuesHolder.setAnimatedValue(PropertyValuesHolder.java:1379) at android.animation.ObjectAnimator.animateValue(ObjectAnimator.java:990) at android.animation.ValueAnimator.setCurrentFraction(ValueAnimator.java:674) at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:637) at android.animation.ValueAnimator.start(ValueAnimator.java:1069) at android.animation.ValueAnimator.start(ValueAnimator.java:1088) at android.animation.ObjectAnimator.start(ObjectAnimator.java:852) at android.animation.ValueAnimator.startWithoutPulsing(ValueAnimator.java:1081) at android.animation.AnimatorSet.handleAnimationEvents(AnimatorSet.java:1142) at android.animation.AnimatorSet.startAnimation(AnimatorSet.java:1227) at android.animation.AnimatorSet.start(AnimatorSet.java:729) at android.animation.AnimatorSet.startWithoutPulsing(AnimatorSet.java:689) at android.animation.AnimatorSet.handleAnimationEvents(AnimatorSet.java:1142) at android.animation.AnimatorSet.startAnimation(AnimatorSet.java:1227) at android.animation.AnimatorSet.start(AnimatorSet.java:729) at android.animation.AnimatorSet.start(AnimatorSet.java:684) at com.itsronald.widget.ViewPagerIndicator$PageListener.onPageSelected(ViewPagerIndicator.java:581) at android.support.v4.view.ViewPager.dispatchOnPageSelected(ViewPager.java:1947) at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:665) at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:631) at android.support.v4.view.ViewPager.onRestoreInstanceState(ViewPager.java:1462) at android.view.View.dispatchRestoreInstanceState(View.java:18608) at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3821) at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3827) at android.view.View.restoreHierarchyState(View.java:18586) at android.support.v4.app.Fragment.restoreViewState(Fragment.java:494) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1486) at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852) at android.support.v4.app.BackStackRecord.executePopOps(BackStackRecord.java:860) at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2622) at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411) at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273) at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:733) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6669) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

thanks in advance.

alejouribesanchez commented 6 years ago

I have the same issue any idea how to fix this ?

ergindogan commented 6 years ago

Unfortunately I switched to another library. If that is an option for you, you can try this alternative.

alejouribesanchez commented 6 years ago

thanks @ergindogan I will do the same

daemontus commented 5 years ago

For anyone interested: If you reset the viewpager to page 0 before the fragment is put to backstack (for example in onStop), the animation won't be triggered at restore and everything will be ok. Its suboptimal because you can't preserve the current page, but better than crashing the whole app.

robinkanatzar commented 5 years ago

I seem to be running into the same problem... Anyone know if there has been any movement on this issue? I ended up changing to the library here: https://github.com/tommybuonomo/dotsindicator