Skip to content

Commit 113c4e2

Browse files
vonovakfacebook-github-bot
authored andcommitted
improve error message in NativeModuleRegistryBuilder.java (#26467)
Summary: ## Motivation I have seen a spike in users reporting this error. Unfortunately I did not receive any repros that would confirm this, but my hypothesis is that they ran into situation when `new XYZPackage()` was present in `getPackages()` method and then the CLI kicked in with autolinking and they were left with this incomplete error. someone more knowledgeable of autolinking should review this. Pull Request resolved: #26467 Differential Revision: D17661242 Pulled By: cpojer fbshipit-source-id: 63dfcd85a0d41d85a0dd52f84ab16cb7ceb64ba2
1 parent 9caf991 commit 113c4e2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ReactAndroid/src/main/java/com/facebook/react/NativeModuleRegistryBuilder.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public void processPackage(ReactPackage reactPackage) {
5252
+ name
5353
+ " tried to override "
5454
+ existingNativeModule.getClassName()
55-
+ ". Check the getPackages() method in MainApplication.java, it might be that module is being created twice. If this was your intention, set canOverrideExistingModule=true");
55+
+ ". Check the getPackages() method in MainApplication.java, it might be that module is being created twice. If this was your intention, set canOverrideExistingModule=true. "
56+
+ "This error may also be present if the package is present only once in getPackages() but is also automatically added later during build time by autolinking. Try removing the existing entry and rebuild.");
5657
}
5758
mModules.remove(existingNativeModule);
5859
}

0 commit comments

Comments
 (0)