From 66e536739e2b863a8f4ec2dac448a4bc7b731484 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Fri, 13 Nov 2020 21:51:04 -0800 Subject: [PATCH] Add additional debug logging for startSurface crashes Summary: There are a very, very small number of crashes in production that are hitting this line. I would like to understand what the existing tag ID is (perhaps it's eqal to the ID being set, which would indicate "double-start"). If not, it indicates that fragments are being reused somewhere, or something else odd is going on with lifecycles. Changelog: [Internal] Reviewed By: ejanzer Differential Revision: D24953785 fbshipit-source-id: 079c86cdb571749662cca46feeaebdd6cb1281f4 --- .../com/facebook/react/fabric/mounting/MountingManager.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.java b/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.java index 74869a0ee45..811393666c7 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.java @@ -103,6 +103,11 @@ public class MountingManager { @ThreadConfined(UI) public void addRootView(int reactRootTag, @NonNull View rootView) { if (rootView.getId() != View.NO_ID) { + FLog.e( + TAG, + "Trying to add RootTag to RootView that already has a tag: existing tag: [%d] new tag: [%d]", + rootView.getId(), + reactRootTag); throw new IllegalViewOperationException( "Trying to add a root view with an explicit id already set. React Native uses " + "the id field to track react tags and will overwrite this field. If that is fine, "