Skip to content

Commit

Permalink
Fix debugging on android for 0.63 (#29204)
Browse files Browse the repository at this point in the history
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 #28746 and #29136

## Changelog
[Android] [Fixed] - Fix crash when enabling debug

Pull Request resolved: #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
  • Loading branch information
devon94 authored and grabbou committed Jul 7, 2020
1 parent 0225f18 commit 6ed1b39
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<? extends NativeModule>[] moduleList =
new Class[] {
JSCHeapCapture.class, JSDevSupport.class,
};
Class<? extends NativeModule>[] moduleList = new Class[] {JSCHeapCapture.class};

final Map<String, ReactModuleInfo> reactModuleInfoMap = new HashMap<>();
for (Class<? extends NativeModule> moduleClass : moduleList) {
Expand Down

0 comments on commit 6ed1b39

Please sign in to comment.