Android-Image-Slider icon indicating copy to clipboard operation
Android-Image-Slider copied to clipboard

Crash on production / Firebase Crash Log

Open mayank250004 opened this issue 4 years ago • 4 comments

Multiple crash log , i found in my production

Logs are from firebase

------------------------------------------------------1st Crash-------------------------------------------------------------- PageIndicatorView.java line 100 com.smarteist.autoimageslider.IndicatorView.PageIndicatorView.onRestoreInstanceState

Fatal Exception: java.lang.IllegalArgumentException Wrong state class, expecting View State but received class com.smarteist.autoimageslider.SliderPager$SavedState instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/0x5. Make sure other views do not use the same id. android.view.View.onRestoreInstanceState (View.java:18973) com.smarteist.autoimageslider.IndicatorView.PageIndicatorView.onRestoreInstanceState (PageIndicatorView.java:100) android.view.View.dispatchRestoreInstanceState (View.java:18945) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:942)

------------------------------------------------------2nd Crash-------------------------------------------------------------

Fatal Exception: java.lang.IllegalStateException The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged! Expected adapter item count: 64800, found: 32400 Pager id: 1 Pager class: class com.smarteist.autoimageslider.SliderPager Problematic adapter: class com.smarteist.autoimageslider.InfiniteAdapter.InfinitePagerAdapter com.smarteist.autoimageslider.SliderPager.populate (SliderPager.java:1131) com.smarteist.autoimageslider.SliderPager.populate (SliderPager.java:1080) com.smarteist.autoimageslider.SliderPager.onMeasure (SliderPager.java:1629) android.view.View.measure (View.java:24726) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:980)

mayank250004 avatar Sep 27 '21 22:09 mayank250004

I am having the same issue. Any luck on solving this?

keskin avatar Sep 30 '21 16:09 keskin

Not Yet.

No reply from the repo owner.

Look Like We have to fix own :)

mayank250004 avatar Oct 02 '21 19:10 mayank250004

Did anyone fix this issue?

MohammadRezaei92 avatar Feb 16 '22 06:02 MohammadRezaei92

After months of struggling with this problem, I finally understood the solution to the problem As Firebase Log says, this problem occurs because multiple views have the same id, but the problem is not the SliderViews themselves, but their Indicator! My fragment had 3 SliderViews and I solved the problem like this:

sliderView1.getPagerIndicator().setId(View.generateViewId());
sliderView2.getPagerIndicator().setId(View.generateViewId());
sliderView3.getPagerIndicator().setId(View.generateViewId());

AliBinkhani avatar Apr 11 '22 15:04 AliBinkhani