From 8c42c019772ba373030558fdbc15b2470f1d7137 Mon Sep 17 00:00:00 2001 From: Devon Deonarine Date: Tue, 7 Jul 2020 12:03:05 -0700 Subject: [PATCH] Fix debugging on android for 0.63 (#29204) Summary: Currently on react native 0.63-rc.0 and 0.63-rc.1 enabling debugging throws an exception. It looks like something may have been missed in unregistering JSDevSupport in this commit c20963e ![crash](https://user-images.githubusercontent.com/14797029/85500252-2acae400-b5b1-11ea-938a-674b55e649b2.gif) This should fix https://github.com/facebook/react-native/issues/28746 and https://github.com/facebook/react-native/issues/29136 ## Changelog [Android] [Fixed] - Fix crash when enabling debug Pull Request resolved: https://github.com/facebook/react-native/pull/29204 Test Plan: To recreate the bug: npx react-native init RN063 --version 0.63.0-rc.1 react-native start react-native run-android Enable debug mode from react native dev menu After this commit, the crash no longer occurs ![non crash](https://user-images.githubusercontent.com/14797029/85500241-269ec680-b5b1-11ea-8cfe-85bfda4dd222.gif) Reviewed By: TheSavior Differential Revision: D22395406 Pulled By: RSNara fbshipit-source-id: 046df77ae1c1de96870fb46f409d59e7d6a68c0d --- .../src/main/java/com/facebook/react/DebugCorePackage.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/DebugCorePackage.java b/ReactAndroid/src/main/java/com/facebook/react/DebugCorePackage.java index 24116e4f99db4e..fb72f43732cc52 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/DebugCorePackage.java +++ b/ReactAndroid/src/main/java/com/facebook/react/DebugCorePackage.java @@ -10,7 +10,6 @@ import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.devsupport.JSCHeapCapture; -import com.facebook.react.devsupport.JSDevSupport; import com.facebook.react.module.annotations.ReactModule; import com.facebook.react.module.annotations.ReactModuleList; import com.facebook.react.module.model.ReactModuleInfo; @@ -50,10 +49,7 @@ public ReactModuleInfoProvider getReactModuleInfoProvider() { return (ReactModuleInfoProvider) reactModuleInfoProviderClass.newInstance(); } catch (ClassNotFoundException e) { // In OSS case, the annotation processor does not run. We fall back on creating this by hand - Class[] moduleList = - new Class[] { - JSCHeapCapture.class, JSDevSupport.class, - }; + Class[] moduleList = new Class[] {JSCHeapCapture.class}; final Map reactModuleInfoMap = new HashMap<>(); for (Class moduleClass : moduleList) {