From d527e03842b65769dfca113960a9847a12a0e463 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Fri, 23 Oct 2020 19:43:59 -0700 Subject: [PATCH] Add some diagnostics to aid in debugging ReactViewGroup.dispatchDraw crashes Summary: I want to see if the child count changes before/after this method execute; that would help pinpoint the cause of these crashes. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D24510064 fbshipit-source-id: 11b4baf15bc5e0beb23d65546605b378d84d1b20 --- .../java/com/facebook/react/views/view/ReactViewGroup.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java index 7d26307e249..30d29b70f92 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java @@ -672,6 +672,9 @@ public class ReactViewGroup extends ViewGroup @Override protected void dispatchDraw(Canvas canvas) { + // TODO T78035906: delete this if we find the root-cause + int initialChildCount = getChildCount(); + try { dispatchOverflowDraw(canvas); super.dispatchDraw(canvas); @@ -685,8 +688,10 @@ public class ReactViewGroup extends ViewGroup e); // Log all children of view, if any + int childCount = getChildCount(); + FLog.e(TAG, "Initial Child Count: %d / final: %d", initialChildCount, childCount); FLog.e(TAG, "Child List:"); - for (int i = 0; i < getChildCount(); i++) { + for (int i = 0; i < childCount; i++) { View child = getChildAt(i); FLog.e( TAG,