Google Play Crash Report: java.lang.IllegalArgumentException: parameter must be a descendant of this view
java.lang.IllegalArgumentException: parameter must be a descendant of this view at android.view.ViewGroup.offsetRectBetweenParentAndChild(ViewGroup.java:5334) at android.view.ViewGroup.offsetDescendantRectToMyCoords(ViewGroup.java:5263) at android.support.v4.widget.NestedScrollView.isWithinDeltaOfScreen(NestedScrollView.java:1273) at android.support.v4.widget.NestedScrollView.onSizeChanged(NestedScrollView.java:1664) at android.view.View.sizeChange(View.java:16757) at android.view.View.setFrame(View.java:16719) at android.view.View.layout(View.java:16636) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16639) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16639) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.support.v7.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:435) at android.view.View.layout(View.java:16639) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16639) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586) at android.widget.LinearLayout.onLayout(LinearLayout.java:1495) at android.view.View.layout(View.java:16639) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2934) at android.view.View.layout(View.java:16639) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2171) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1931) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) at android.view.Choreographer.doCallbacks(Choreographer.java:670) at android.view.Choreographer.doFrame(Choreographer.java:606) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) 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:5466) 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)
Hmm, there is not a single line of our code in the stack trace. It happens every now and then on various devices. One user reported it happened when changing the time zone of a task.
See http://stackoverflow.com/questions/10721907/java-lang-illegalargumentexception-parameter-must-be-a-descendant-of-this-view and http://stackoverflow.com/questions/26752161/illegalargumentexception-parameter-must-be-a-descendant-of-this-view-at-viewgrou and http://stackoverflow.com/questions/7100555/preventing-catching-illegalargumentexception-parameter-must-be-a-descendant-of and http://stackoverflow.com/questions/30585561/another-java-lang-illegalargumentexception-parameter-must-be-a-descendant-of-th
@lemonboston please take care of this one.
I think we are kind of in the dark here, but this is what I could collect:
- The error indicates that a ViewGroup tries to do something with a View that is not its descendant (not sure how and when it gets detached or not attached)
- Based on the user report that it happened when changing the time zone, this probably happens on EditTaskFragment and the NestedScrollView in the stack trace is the one in that layout
- The reports on SO with this error either have some scrolling or ListView in the stacktrace and most of them suggest the issue is caused by some view having focus while scrolling
- The suggested solutions are mostly about removing all focus, for example when the user starts scrolling. I guess this is not an option for us.
- Another suggestion is to change
adjustResizetoadjustPanfor keyboard handling, which again not good, because we want to allow scrolling while keyboard is up
I noticed though that when some EditText is in focus on the screen and the keyboard is up, and I tap on the Time Zone or any date selectors, their dialog comes up but the EditText is still in focus, the keyboard is still up covered by the dialog. Is this intentional or would it better that EditTexts loose focus here? I am just guessing that this could be one situation when something goes wrong, although I couldn't reproduce the crash. So if it was also a better UX to loose the EditText focus when something else is selected, we could maybe implement that and see later if that fixed this or not.
What do you think? Any other idea, tips to look into?
No ideas so far. Could that be a bug in the support library?
onSizeChanged seems to indicate that the keyboard either popped up or was closed when it happened.
I suggest we postpone this as well, since the editor needs an overhaul anyway.
Could that be a bug in the support library?
I don't know but I haven't come across anybody mentioning this on SO.
I suggest we postpone this as well, since the editor needs an overhaul anyway.
Ok, and thanks.
Is there some views be multiplexed? i.g. mltiplex header view in two listview will cause this problem occasionally
Facing the same issue but all the crashes are only in samsung devices that too running Android10 only. Crashlytics info : Branch : Samsung Android Version : Android 10 Frequency : Rarely
Facing the same issue in a NestedScrollView (having a recycler view). There is no edit text as well on my screen, still it is crashing. Crashing intermittently in Android 7, 8, 8.1 devices. Any help will be highly appreciated.
if you're affected by this crash, please provide some insights into when this happens. Which view was opened, which action triggered it, etc.
I have not been able to reproduce this crash in my device (Android 10) but some of my users are complaining about receiving this crash at random times. Even they are unaware of any particular action that is producing it. But the common thing in all the crashes is -
- It is happening in Android 7, 8 or 8.1 devices
- It is happening on the activity that has a Nested RecyclerView inside a NestedScrollView. There is no Edit text on this screen. I have not been able to debug this crash. I have already added "android:descendantFocusability="blocksDescendants" in the xml file and it had helped fix the crash but it started coming again after a few weeks. Now I am unsure why this is happening again.
Same issue here, cannot reproduce on my end, but it happens on a screen that has a Flatlist inside a scrollview.
I have not been able to reproduce this crash in my device (Android 10) but some of my users are complaining about receiving this crash at random times. Even they are unaware of any particular action that is producing it. But the common thing in all the crashes is -
- It is happening in Android 7, 8 or 8.1 devices
- It is happening on the activity that has a Nested RecyclerView inside a NestedScrollView. There is no Edit text on this screen. I have not been able to debug this crash. I have already added "android:descendantFocusability="blocksDescendants" in the xml file and it had helped fix the crash but it started coming again after a few weeks. Now I am unsure why this is happening again.
Hey @Diksha0912 i have the same issue. did you find any solution for that?
I have not been able to reproduce this crash in my device (Android 10) but some of my users are complaining about receiving this crash at random times. Even they are unaware of any particular action that is producing it. But the common thing in all the crashes is -
- It is happening in Android 7, 8 or 8.1 devices
- It is happening on the activity that has a Nested RecyclerView inside a NestedScrollView. There is no Edit text on this screen. I have not been able to debug this crash. I have already added "android:descendantFocusability="blocksDescendants" in the xml file and it had helped fix the crash but it started coming again after a few weeks. Now I am unsure why this is happening again.
Hey @Diksha0912 i have the same issue. did you find any solution for that?
Hey @Piyush-Porwal , I did not get a fix for this yet. It is mostly because of the nested recycler view but still facing this crash.