-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Silence warning "Class RCTCxxModule was not exported" #19794
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
@shergin I'm hitting this also... is the fix in this PR ok, or should this class name be filtered out in e.g. if (isModuleSuperClass) {
break;
}
+
+ if (strncmp(class_getName(superclass), "RCTCxxModule", strlen("RCTCxxModule")) == 0) {
+ break;
+ }
RCTLogWarn(@"Class %@ was not exported. Did you forget to use RCT_EXPORT_MODULE()?", cls);
break; |
Yes, the module should not be exported. Instead the module should be ignored in RCTVerifyAllModulesExported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chrisballinger This module should not be exported. See @javache 's comment, and the code snippet I provided that fixes the issue in a safer way.
@chrisballinger thanks for submitting this PR -- I've implemented the alternative fix requested by @javache in a separate PR and will get that merged as soon as CI passes. |
@dlowder-salesforce @javache Awesome thanks! |
Summary: <!-- Required: Write your motivation here. If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged. --> On a relatively stock / default setup of RN on iOS you'll see the warning "Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?" pop up on every launch. This change resolves that issue. Fixes #14806 . This supersedes PR #19794 . Try a fresh project by following the RN iOS tutorial, and observe that there are no more warnings after making this change. [IOS] [MINOR] [CxxBridge] - Fix "Class RCTCxxModule was not exported" Closes #19880 Differential Revision: D8653809 Pulled By: hramos fbshipit-source-id: c48529c2d74ddd40a90bc0e06e405078e25b72e3
@chrisballinger @dlowder-salesforce @javache |
Summary: <!-- Required: Write your motivation here. If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged. --> On a relatively stock / default setup of RN on iOS you'll see the warning "Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?" pop up on every launch. This change resolves that issue. Fixes facebook#14806 . This supersedes PR facebook#19794 . Try a fresh project by following the RN iOS tutorial, and observe that there are no more warnings after making this change. [IOS] [MINOR] [CxxBridge] - Fix "Class RCTCxxModule was not exported" Closes facebook#19880 Differential Revision: D8653809 Pulled By: hramos fbshipit-source-id: c48529c2d74ddd40a90bc0e06e405078e25b72e3
Summary: <!-- Required: Write your motivation here. If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged. --> On a relatively stock / default setup of RN on iOS you'll see the warning "Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?" pop up on every launch. This change resolves that issue. Fixes #14806 . This supersedes PR #19794 . Try a fresh project by following the RN iOS tutorial, and observe that there are no more warnings after making this change. [IOS] [MINOR] [CxxBridge] - Fix "Class RCTCxxModule was not exported" Closes #19880 Differential Revision: D8653809 Pulled By: hramos fbshipit-source-id: c48529c2d74ddd40a90bc0e06e405078e25b72e3
On a relatively stock / default setup of RN on iOS you'll see the warning "Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?" pop up on every launch. This change resolves that issue.
Fixes #14806
Test Plan
Try a fresh project by following the RN iOS tutorial, and observe that there are no more warnings after making this change.
Release Notes
[IOS] [MINOR] [CxxBridge] - Fix "Class RCTCxxModule was not exported"