New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Library crashes if recyclerview's item's rootview contains "layout_margin" attribute. #9
Comments
Great catch, thanks. I'll check this out in depth soon and have a fix before long. |
@mansigoel94 would you mind sending me the XML layout file that is causing the error? I'm trying to recreate this on my side and I am unable to by just setting the recyclerview's root view |
<android.support.constraint.ConstraintLayout
</android.support.constraint.ConstraintLayout> But in another layout where you define recycler view items then in rootview margin would break code <android.support.constraint.ConstraintLayout
</android.support.constraint.ConstraintLayout> |
Unfortunately, I still haven't been able to recreate the bug on my end. I added the Upon further inspection of the stacktrace, it seems that this line is the actual bug:
Are you setting an OnFlingListener in your code where you setup your recyclerview? Or are you calling |
@mansigoel94 any update on this? I'm going to close the issue if my comment above is the overall issue. |
No I haven't used any ScrollListener or FlingListener and this error is still reproducible on my machine. I will share sample project with you. |
https://github.com/mansigoel94/Library-Issue.git. |
@mansigoel94 based on the code you shared, I can see that you are using version 1.0.3 and indeed the crash happens because null is getting to the RecyclerView's That was fixed by @rbro112 in this commit (line 268): So I think the solution to your bug will be updating to the latest version [ current is 1.0.6 ] of the library 😃 |
@wching you're killing it! Thanks so much. That's why I wasn't able to replicate, locally I've been experimenting with the most up to date version of the library. Will be good to know for future reference that often I'll need to drop my versioning down to ensure I'm checking older versions. @mansigoel94 please let me know if updating to 1.0.6 works! |
Looks like 1.0.6+ is the fix. Closing this issue! |
Library crashes if recyclerview's item's rootview contains "layout_margin" attribute.
Below is the crash log ::
01-19 17:02:50.296 18167-18167/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.lrm.emark, PID: 18167
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lrm.emark/com.lrm.emark.MainActivity}: java.lang.IllegalStateException: An instance of OnFlingListener already set.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Caused by: java.lang.IllegalStateException: An instance of OnFlingListener already set.
at android.support.v7.widget.SnapHelper.setupCallbacks(SnapHelper.java:115)
at android.support.v7.widget.SnapHelper.attachToRecyclerView(SnapHelper.java:103)
at com.lrm.emark.feed.FeedbackFragment.onCreateView(FeedbackFragment.java:131)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:2354)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1419)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1740)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1809)
at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:799)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2580)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2367)
at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2322)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2229)
at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3221)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3171)
at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:192)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:560)
at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:177)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1256)
at android.app.Activity.performStart(Activity.java:6959)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2890)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
The text was updated successfully, but these errors were encountered: