microg / GmsCore

Free implementation of Play Services
https://microg.org
Apache License 2.0
8.41k stars 1.7k forks source link

scrolling through apps in the relevant section in microg settings causes a crash in gmscore #861

Open patrickdrd opened 5 years ago

patrickdrd commented 5 years ago

2019-07-03-13-40-22.txt

it should be this one:

07-03 13:40:10.009 E/AndroidRuntime(11396): java.lang.IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling android.support.v7.widget.RecyclerView{85f75e2 VFED.V... .F...... 0,0-720,1008 #7f0800b4 app:id/recycler_view}, adapter:com.takisoft.fix.support.v7.preference.PreferenceGroupAdapter@55c3d73, layout:android.support.v7.widget.LinearLayoutManager@cf16430, context:android.view.ContextThemeWrapper@c6e78a9
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.support.v7.widget.RecyclerView.assertNotInLayoutOrScroll(RecyclerView.java:2880)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.support.v7.widget.RecyclerView$RecyclerViewDataObserver.onItemRangeChanged(RecyclerView.java:5292)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.support.v7.widget.RecyclerView$AdapterDataObservable.notifyItemRangeChanged(RecyclerView.java:12012)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.support.v7.widget.RecyclerView$Adapter.notifyItemChanged(RecyclerView.java:7114)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.support.v7.preference.PreferenceGroupAdapter.onPreferenceChange(PreferenceGroupAdapter.java:276)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.support.v7.preference.Preference.notifyChanged(Preference.java:1256)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.support.v7.preference.Preference.setSummary(Preference.java:787)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at org.microg.gms.ui.GcmFragment$GcmAppPreference.updateViewDetails(GcmFragment.java:207)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at org.microg.gms.ui.GcmFragment$GcmAppPreference.onBindViewHolder(GcmFragment.java:216)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.support.v7.preference.PreferenceGroupAdapter.onBindViewHolder(PreferenceGroupAdapter.java:381)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.support.v7.preference.PreferenceGroupAdapter.onBindViewHolder(PreferenceGroupAdapter.java:45)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6781)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6823)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5752)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6019)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.support.v7.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:286)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.support.v7.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:343)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.support.v7.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:359)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:366)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.support.v7.widget.GapWorker.run(GapWorker.java:397)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.os.Handler.handleCallback(Handler.java:751)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.os.Handler.dispatchMessage(Handler.java:95)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.os.Looper.loop(Looper.java:154)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at android.app.ActivityThread.main(ActivityThread.java:6236)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at java.lang.reflect.Method.invoke(Native Method)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:891)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:781)
07-03 13:40:10.009 E/AndroidRuntime(11396):     at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:103)
voidstarstar commented 5 years ago

Possibly related to #754 and #743.

What version of microG are you using?

patrickdrd commented 5 years ago

I've noticed it happening for a (long) while, I've got microg since version 0.2.6 and this happened to me in 0.2.7, the logs are from 0.2.8

voidstarstar commented 5 years ago

Also, what version of Android are you using? Does it happen to be 8.0+?

If so, I'm wondering if this was already fixed in #744, but that fix might only apply to apps uninstalled after microG was upgraded to include this PR. (If this is the case, one workaround might be to just reinstall then uninstall the problematic apps. Unfortunately I don't have 8.0+, so I've been trying to fix this somewhat blindly.)

patrickdrd commented 5 years ago

Also, what version of Android are you using? Does it happen to be 8.0+?

no, nougat, 7.1

ravilov commented 5 years ago

Same here. Seen it once or twice before but I just upgraded to the latest 0.2.8 and while going through microG settings I happened to have come across it again. Running Android 7.1.1. Was just about to open an issue when I saw this. Oh well, here's my logcat anyway:

java.lang.IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling android.support.v7.widget.RecyclerView{aa8547 VFED.V... .F...... 0,0-1440,2220 #7f0800b4 app:id/recycler_view}, adapter:com.takisoft.fix.support.v7.preference.PreferenceGroupAdapter@c1ceac1, layout:android.support.v7.widget.LinearLayoutManager@a1cf266, context:android.view.ContextThemeWrapper@11279a7
    at android.support.v7.widget.RecyclerView.assertNotInLayoutOrScroll(RecyclerView.java:2880)
    at android.support.v7.widget.RecyclerView$RecyclerViewDataObserver.onItemRangeChanged(RecyclerView.java:5292)
    at android.support.v7.widget.RecyclerView$AdapterDataObservable.notifyItemRangeChanged(RecyclerView.java:12012)
    at android.support.v7.widget.RecyclerView$Adapter.notifyItemChanged(RecyclerView.java:7114)
    at android.support.v7.preference.PreferenceGroupAdapter.onPreferenceChange(PreferenceGroupAdapter.java:276)
    at android.support.v7.preference.Preference.notifyChanged(Preference.java:1256)
    at android.support.v7.preference.Preference.setSummary(Preference.java:787)
    at org.microg.gms.ui.GcmFragment$GcmAppPreference.updateViewDetails(GcmFragment.java:207)
    at org.microg.gms.ui.GcmFragment$GcmAppPreference.onBindViewHolder(GcmFragment.java:216)
    at android.support.v7.preference.PreferenceGroupAdapter.onBindViewHolder(PreferenceGroupAdapter.java:381)
    at android.support.v7.preference.PreferenceGroupAdapter.onBindViewHolder(PreferenceGroupAdapter.java:45)
    at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6781)
    at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6823)
    at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5752)
    at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6019)
    at android.support.v7.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:286)
    at android.support.v7.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:343)
    at android.support.v7.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:359)
    at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:366)
    at android.support.v7.widget.GapWorker.run(GapWorker.java:397)
    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:6176)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
    at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:107)
Nanolx commented 5 years ago

You're both using Xposed. What happens when you disable Xposed, does the issue still occur? Especially, do you use any Xposed module that alters the general System UI?

Back in the days I was still using Xposed I had similar issues with some applications, crashes caused by some Xposed module.

All I can say is that I never ran into the issue since the proposed fix by @voidstarstar was merged.

patrickdrd commented 5 years ago

the modules I use are: all notifications expanded backup all apps (for helium backup app) customshare disableflagsecure hide emergency button swyperow

would you think any of them alters general system ui?

Nanolx commented 5 years ago

I don't know for sure, but you may try with disabling them one at a time to check which one may trigger the issue.

patrickdrd commented 5 years ago

@ravilov do you have any of these modules?

voidstarstar commented 5 years ago

As a side note, we should add an easy way to dump the microG database to the log if that's not already being done. Maybe when opening the app or when opening the About screen. That would make it easier to check for inconsistencies in the database entries (e.g. an app that's in the db that was already uninstalled).

ravilov commented 5 years ago

@patrickdrd Surprisingly no, I don't have any of those. My modules are:

I know some of them do indeed hook into com.android.systemui. I felt a little bit uncomfortable booting my device without Xposed, but I did it anyway. It still crashes just the same. Here's the new logcat:

java.lang.IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling android.support.v7.widget.RecyclerView{49be6ea VFED.V... .F....ID 0,0-1440,2220 #7f0800b4 app:id/recycler_view}, adapter:com.takisoft.fix.support.v7.preference.PreferenceGroupAdapter@d703f09, layout:android.support.v7.widget.LinearLayoutManager@5f5c50e, context:android.view.ContextThemeWrapper@2835b2f
    at android.support.v7.widget.RecyclerView.assertNotInLayoutOrScroll(RecyclerView.java:2880)
    at android.support.v7.widget.RecyclerView$RecyclerViewDataObserver.onItemRangeChanged(RecyclerView.java:5292)
    at android.support.v7.widget.RecyclerView$AdapterDataObservable.notifyItemRangeChanged(RecyclerView.java:12012)
    at android.support.v7.widget.RecyclerView$Adapter.notifyItemChanged(RecyclerView.java:7114)
    at android.support.v7.preference.PreferenceGroupAdapter.onPreferenceChange(PreferenceGroupAdapter.java:276)
    at android.support.v7.preference.Preference.notifyChanged(Preference.java:1256)
    at android.support.v7.preference.Preference.setSummary(Preference.java:787)
    at org.microg.gms.ui.GcmFragment$GcmAppPreference.updateViewDetails(GcmFragment.java:207)
    at org.microg.gms.ui.GcmFragment$GcmAppPreference.onBindViewHolder(GcmFragment.java:216)
    at android.support.v7.preference.PreferenceGroupAdapter.onBindViewHolder(PreferenceGroupAdapter.java:381)
    at android.support.v7.preference.PreferenceGroupAdapter.onBindViewHolder(PreferenceGroupAdapter.java:45)
    at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6781)
    at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6823)
    at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5752)
    at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6019)
    at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858)
    at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854)
    at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230)
    at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1557)
    at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517)
    at android.support.v7.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1331)
    at android.support.v7.widget.LinearLayoutManager.scrollVerticallyBy(LinearLayoutManager.java:1075)
    at android.support.v7.widget.RecyclerView.scrollStep(RecyclerView.java:1832)
    at android.support.v7.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:5067)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
    at android.view.Choreographer.doCallbacks(Choreographer.java:686)
    at android.view.Choreographer.doFrame(Choreographer.java:618)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
    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:6176)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)

The easiest way I found to reproduce this is to go to microG settings, then to Google Cloud Messaging (it should say "ON / xx registered Apps"), and then (assuming you have a decent amount of apps in the list, I have 28) just scroll up and down wildly, hehe.

voidstarstar commented 5 years ago

This may sound silly, but does it only crash when scrolling quickly? When you scroll very slowly from top to bottom, does it work fine?

patrickdrd commented 5 years ago

it crashes slowly too, but you have to wait a bit longer

drrossum commented 5 years ago

Here is a log that I captured on a crash while scrolling through the GCM apps list.

I'm using v0.2.8.17785-mapbox on Android Pie.

07-05 10:41:23.550 17694 17694 D AndroidRuntime: Shutting down VM
07-05 10:41:23.565 17694 17694 E AndroidRuntime: FATAL EXCEPTION: main
07-05 10:41:23.565 17694 17694 E AndroidRuntime: Process: com.google.android.gms, PID: 17694
07-05 10:41:23.565 17694 17694 E AndroidRuntime: java.lang.IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling android.support.v7.widget.RecyclerView{35842a9 VFED.V... ........ 0,0-1080,1512 #7f0800b4 app:id/recycler_view}, adapter:com.takisoft.fix.support.v7.preference.PreferenceGroupAdapter@89a102e, layout:android.support.v7.widget.LinearLayoutManager@c1b17cf, context:android.view.ContextThemeWrapper@1e4655c
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.support.v7.widget.RecyclerView.assertNotInLayoutOrScroll(RecyclerView.java:2880)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.support.v7.widget.RecyclerView$RecyclerViewDataObserver.onItemRangeChanged(RecyclerView.java:5292)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.support.v7.widget.RecyclerView$AdapterDataObservable.notifyItemRangeChanged(RecyclerView.java:12012)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.support.v7.widget.RecyclerView$Adapter.notifyItemChanged(RecyclerView.java:7114)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.support.v7.preference.PreferenceGroupAdapter.onPreferenceChange(PreferenceGroupAdapter.java:276)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.support.v7.preference.Preference.notifyChanged(Preference.java:1256)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.support.v7.preference.Preference.setSummary(Preference.java:787)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at org.microg.gms.ui.GcmFragment$GcmAppPreference.updateViewDetails(GcmFragment.java:207)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at org.microg.gms.ui.GcmFragment$GcmAppPreference.onBindViewHolder(GcmFragment.java:216)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.support.v7.preference.PreferenceGroupAdapter.onBindViewHolder(PreferenceGroupAdapter.java:381)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.support.v7.preference.PreferenceGroupAdapter.onBindViewHolder(PreferenceGroupAdapter.java:45)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6781)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6823)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5752)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6019)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.support.v7.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:286)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.support.v7.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:343)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.support.v7.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:359)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:366)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.support.v7.widget.GapWorker.run(GapWorker.java:397)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.os.Handler.handleCallback(Handler.java:873)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:99)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:193)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:6718)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
07-05 10:41:23.565 17694 17694 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
07-05 10:41:23.576 17694 17694 I Process : Sending signal. PID: 17694 SIG: 9