diff --git a/ReactAndroid/src/main/java/com/facebook/react/NativeModuleRegistryBuilder.java b/ReactAndroid/src/main/java/com/facebook/react/NativeModuleRegistryBuilder.java index 5a3e3564d..49a150bb4 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/NativeModuleRegistryBuilder.java +++ b/ReactAndroid/src/main/java/com/facebook/react/NativeModuleRegistryBuilder.java @@ -49,12 +49,12 @@ public class NativeModuleRegistryBuilder { if (reactPackage instanceof LazyReactPackage) { LazyReactPackage lazyReactPackage = (LazyReactPackage) reactPackage; List moduleSpecs = lazyReactPackage.getNativeModules(mReactApplicationContext); - Map reactModuleInfoMap = lazyReactPackage.getReactModuleInfoProvider() - .getReactModuleInfos(); + Map reactModuleInfoMap = + lazyReactPackage.getReactModuleInfoProvider().getReactModuleInfos(); for (ModuleSpec moduleSpec : moduleSpecs) { Class type = moduleSpec.getType(); - ReactModuleInfo reactModuleInfo = reactModuleInfoMap.get(type); + ReactModuleInfo reactModuleInfo = reactModuleInfoMap.get(type.getCanonicalName()); ModuleHolder moduleHolder; if (reactModuleInfo == null) { if (BaseJavaModule.class.isAssignableFrom(type)) { diff --git a/ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfoProvider.java b/ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfoProvider.java index 24d2c80af..54875ad93 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfoProvider.java +++ b/ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfoProvider.java @@ -12,5 +12,5 @@ import java.util.Map; */ public interface ReactModuleInfoProvider { - Map getReactModuleInfos(); + Map getReactModuleInfos(); } diff --git a/ReactAndroid/src/main/java/com/facebook/react/module/processing/ReactModuleSpecProcessor.java b/ReactAndroid/src/main/java/com/facebook/react/module/processing/ReactModuleSpecProcessor.java index 9f269ef6e..1d5b4ae59 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/module/processing/ReactModuleSpecProcessor.java +++ b/ReactAndroid/src/main/java/com/facebook/react/module/processing/ReactModuleSpecProcessor.java @@ -62,7 +62,7 @@ public class ReactModuleSpecProcessor extends AbstractProcessor { private static final TypeName COLLECTIONS_TYPE = ParameterizedTypeName.get(Collections.class); private static final TypeName MAP_TYPE = ParameterizedTypeName.get( Map.class, - Class.class, + String.class, ReactModuleInfo.class); private static final TypeName INSTANTIATED_MAP_TYPE = ParameterizedTypeName.get(HashMap.class); @@ -155,7 +155,7 @@ public class ReactModuleSpecProcessor extends AbstractProcessor { builder.addStatement("$T map = new $T()", MAP_TYPE, INSTANTIATED_MAP_TYPE); for (String nativeModule : nativeModules) { - String keyString = nativeModule + ".class"; + String keyString = nativeModule; TypeElement typeElement = mElements.getTypeElement(nativeModule); if (typeElement == null) { @@ -191,7 +191,7 @@ public class ReactModuleSpecProcessor extends AbstractProcessor { .append(")") .toString(); - builder.addStatement("map.put(" + keyString + ", " + valueString + ")"); + builder.addStatement("map.put(\"" + keyString + "\", " + valueString + ")"); } builder.addStatement("return map"); }