Verified
Status Update
Comments
am...@google.com <am...@google.com>
am...@google.com <am...@google.com> #2
I am getting the same problem after the latest update...
yb...@google.com <yb...@google.com>
ta...@gmail.com <ta...@gmail.com> #3
I think this might be the same as issue 36949180 . As mentioned in the comments there, try:
As a temporary workaround, try turning off Preferences > Compiler > Use External Build.
As a temporary workaround, try turning off Preferences > Compiler > Use External Build.
am...@google.com <am...@google.com> #4
Deleting the out folder before rebuilding solves the problem
go...@gmail.com <go...@gmail.com> #5
turning off Preferences > Compiler > Use External Build doesn't work if you have other modules as dependencies.
go...@gmail.com <go...@gmail.com> #6
I'm having the same problem.
ta...@gmail.com <ta...@gmail.com> #8
Also having this problem, but turning off Preferences > Compiler > Use External Build worked for me, even though I have other modules as dependencies, despite what jai.chan mentioned.
pr...@gmail.com <pr...@gmail.com> #10
Problem exists. Turning off "Use external build" helps.
yb...@google.com <yb...@google.com> #11
Also having the same problem.But I don't know How can I fix ?
jo...@gmail.com <jo...@gmail.com> #12
The problem is still there... :s
st...@googlemail.com <st...@googlemail.com> #13
having the same issue here too
ta...@gmail.com <ta...@gmail.com> #15
A shame that google is not able to solve this issue since several years but is able to pop out yet another android version.
sk...@googlemail.com <sk...@googlemail.com> #16
Android Studio 1.4 and this or similar bug is still here! My project is completely blocked due to inability to add a new activity class without getting "cannot find symbol" for it. The other classes are getting compiled except that activty. I've checked in the build/intermediates/classes - the activity .class is missing, not even compiled though it is hollow class, no syntax error.
Already tried:
Invalidate Cache and Restart - nope
Deleted /build directory and rebuild - nope
./gradlew clean of entire project - nope
Restarting after everything above - nope
Recreating a new blank activity - nope
Checked manifest entries for the activity - nope
Combination of the above - nope
Desperation mode: on
Already tried:
Invalidate Cache and Restart - nope
Deleted /build directory and rebuild - nope
./gradlew clean of entire project - nope
Restarting after everything above - nope
Recreating a new blank activity - nope
Checked manifest entries for the activity - nope
Combination of the above - nope
Desperation mode: on
cc...@android.com <cc...@android.com> #17
I've just managed to workaround it! Simple Refactor > Move to another package did remove the error, but after I moved it back to the original package the error appeared again. Have NO idea what's going on!
[Deleted User] <[Deleted User]> #18
Damn, I've found that class in the long forgotten exclude list in my build.gradle! What a stupid mistake of mine. Mystery revealed! (chuckle)
cc...@android.com <cc...@android.com> #19
#19 and #21 are slightly different from the original issue, since they're from LinearLayoutManager and GridLayoutManager. I see how this may be occurring, and will put in a fix.
As to the case in #18, I'm not sure how StaggeredGridLayoutManager could have these issues in 25.1.1, looking at the code (and scrolling around manually in a 2 column staggered grid), I'm not seeing the issue. Are you sure you're both on 25.1.1, and seeing StaggeredGridLayoutManager in the stack trace?
As to the case in #18, I'm not sure how StaggeredGridLayoutManager could have these issues in 25.1.1, looking at the code (and scrolling around manually in a 2 column staggered grid), I'm not seeing the issue. Are you sure you're both on 25.1.1, and seeing StaggeredGridLayoutManager in the stack trace?
bf...@gmail.com <bf...@gmail.com> #20
Getting the same stacktrace with RecyclerView for support library 25.1.1
Fatal Exception: java.lang.IllegalArgumentException: Pixel distance must be non-negative
at android.support.v7.widget.GapWorker$LayoutPrefetchRegistryImpl.addPosition(GapWorker.java:110)
at android.support.v7.widget.LinearLayoutManager.collectPrefetchPositionsForLayoutState(LinearLayoutManager.java:1202)
at android.support.v7.widget.LinearLayoutManager.collectAdjacentPrefetchPositions(LinearLayoutManager.java:1300)
at android.support.v7.widget.GapWorker$LayoutPrefetchRegistryImpl.collectPrefetchPositionsFromView(GapWorker.java:94)
at android.support.v7.widget.GapWorker.buildTaskList(GapWorker.java:213)
at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:343)
at android.support.v7.widget.GapWorker.run(GapWorker.java:370)
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:6119)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Fatal Exception: java.lang.IllegalArgumentException: Pixel distance must be non-negative
at android.support.v7.widget.GapWorker$LayoutPrefetchRegistryImpl.addPosition(GapWorker.java:110)
at android.support.v7.widget.LinearLayoutManager.collectPrefetchPositionsForLayoutState(LinearLayoutManager.java:1202)
at android.support.v7.widget.LinearLayoutManager.collectAdjacentPrefetchPositions(LinearLayoutManager.java:1300)
at android.support.v7.widget.GapWorker$LayoutPrefetchRegistryImpl.collectPrefetchPositionsFromView(GapWorker.java:94)
at android.support.v7.widget.GapWorker.buildTaskList(GapWorker.java:213)
at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:343)
at android.support.v7.widget.GapWorker.run(GapWorker.java:370)
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:6119)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
yu...@gmail.com <yu...@gmail.com> #21
[Comment deleted]
em...@gmail.com <em...@gmail.com> #22
I have the same crash using support lib 25.2.0. Is there a different issue to track this crash from a LinearLayoutManager, looks like it was opened for the StaggeredGridLayoutManager
Pixel distance must be non-negative
java.lang.IllegalArgumentException: Pixel distance must be non-negative
at android.support.v7.widget.GapWorker$LayoutPrefetchRegistryImpl.addPosition(GapWorker.java:110)
at android.support.v7.widget.LinearLayoutManager.collectPrefetchPositionsForLayoutState(LinearLayoutManager.java:1202)
at android.support.v7.widget.LinearLayoutManager.collectAdjacentPrefetchPositions(LinearLayoutManager.java:1300)
at android.support.v7.widget.GapWorker$LayoutPrefetchRegistryImpl.collectPrefetchPositionsFromView(GapWorker.java:94)
at android.support.v7.widget.GapWorker.buildTaskList(GapWorker.java:213)
at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:343)
at android.support.v7.widget.GapWorker.run(GapWorker.java:370)
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:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Pixel distance must be non-negative
java.lang.IllegalArgumentException: Pixel distance must be non-negative
at android.support.v7.widget.GapWorker$LayoutPrefetchRegistryImpl.addPosition(GapWorker.java:110)
at android.support.v7.widget.LinearLayoutManager.collectPrefetchPositionsForLayoutState(LinearLayoutManager.java:1202)
at android.support.v7.widget.LinearLayoutManager.collectAdjacentPrefetchPositions(LinearLayoutManager.java:1300)
at android.support.v7.widget.GapWorker$LayoutPrefetchRegistryImpl.collectPrefetchPositionsFromView(GapWorker.java:94)
at android.support.v7.widget.GapWorker.buildTaskList(GapWorker.java:213)
at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:343)
at android.support.v7.widget.GapWorker.run(GapWorker.java:370)
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:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
xl...@gmail.com <xl...@gmail.com> #23
got the same crash with 25.1.1 annd 25.2.0.
here you can find the demo project to reproduce this issue:https://github.com/longerian/VlayoutDemo
here you can find the demo project to reproduce this issue:
bf...@gmail.com <bf...@gmail.com> #24
Faced the same issue with 25.1.1. Fixed it using
StaggeredGridLayoutManager.setItemPrefetchEnabled(false);
or
LinearLayoutManager.setItemPrefetchEnabled(false);
StaggeredGridLayoutManager.setItemPrefetchEnabled(false);
or
LinearLayoutManager.setItemPrefetchEnabled(false);
xl...@gmail.com <xl...@gmail.com> #25
am...@google.com <am...@google.com> #26
The issue is fixed in latest support libraries. If you come across the issue again, please let us know by raising a new issue along with the sample code which reproduces the issue.
Thanks.
Thanks.
Description
Version used: 25.1.0
Theme used: Theme.AppCompat.Light.DarkActionBar
Devices/Android versions reproduced on: Android API 23 AVD emulator, Android 5.1 user devices
- Relevant code to trigger the issue.
The important parts of the code:
1. Uses StaggeredGridLayoutManager with multiple columns.
2. Some of the items are full span: `StaggeredGridLayoutManager.LayoutParams.setFullSpan(true)`
3. Call `RecyclerView.Adapter.notifyItemChanged()` on UI thread (e.g. post delayed Handler)
When running the example app, try flinging the RecyclerView up and down several times. It will eventually force close.
- Stack trace:
java.lang.IllegalArgumentException: Pixel distance must be non-negative
at android.support.v7.widget.GapWorker$LayoutPrefetchRegistryImpl.addPosition(GapWorker.java:110)
at android.support.v7.widget.StaggeredGridLayoutManager.collectAdjacentPrefetchPositions(StaggeredGridLayoutManager.java:2109)
at android.support.v7.widget.GapWorker$LayoutPrefetchRegistryImpl.collectPrefetchPositionsFromView(GapWorker.java:94)
at android.support.v7.widget.GapWorker.buildTaskList(GapWorker.java:213)
at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:343)
at android.support.v7.widget.GapWorker.run(GapWorker.java:370)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)