React-native: Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?

Created on 5 Mar 2018  路  28Comments  路  Source: facebook/react-native

There are warnings on app start:

2018-03-05 21:10:33.505 [warn][tid:main][RCTBridge.m:120] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2018-03-05 21:10:33.505169+0700 AwesomeProject[23617:4551316] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?

Environment

Environment:
  OS: macOS High Sierra 10.13.3
  Node: 9.7.1
  Yarn: 1.5.1
  npm: 5.6.0
  Watchman: 4.9.0
  Xcode: Xcode 9.2 Build version 9C40b
  Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
  react: ^16.3.0-alpha.1 => 16.3.0-alpha.1
  react-native: 0.54.0 => 0.54.0

Expected Behavior

No warnings.

Actual Behavior

There are warnings.

Steps to Reproduce

  1. react-native init AwesomeProject
  2. Open ios/AwesomeProject.xcodeproj
  3. Run the app and look at the output.
  4. There will be warnings among first several lines.

I've tested several versions back (0.49) and the issue is there as well.

Sample project

https://github.com/vshab/react-native-0.54-run-warning

iOS Locked

Most helpful comment

@frayhan32 For now it's not the best solution, but to avoid the warning we can ignore it:

import { YellowBox } from 'react-native';
YellowBox.ignoreWarnings(['Class RCTCxxModule']);

All 28 comments

I'm having the same issue after I upgraded to RN 0.54.

I have this issue too after upgrading to RN 0.54.1. If I reload the app in the simulator the warning goes away.

Same as @leejones45, getting this error after upgrading and only on first load.

Same with me
react-native: 0.55.1

Same with me
react-native: 0.55.2

Same here when running on my device via xCode.
react-native: 0.55.3

Same here with react-native: 0.55.3. Seems it happens after upgrade react-native to a version > 0.54.

Also seeing this with react-native 0.55.3.

This is a duplicate of #14806

It's a harmless issue and you can ignore it, but quite confusing when you encounter it at first. Sadly it seems that nobody had the time to fix this yet, so it is still in the current version.

Me too in [email protected]

me too

me too

me too

me too

me too and a bunch of issues with Yoga include< algorithm > etc.

Any update on this issue? I know it's harmless but it still bothers me

The message should be removed if it's really not an issue. Or FB needs to fix the condition that checks for whatever it is this is trying to check for.

Any update on this?

When I want to run on device, I need to have RCTNetwork.xcodeproj and RCTWebSocket.xcodeproj manually linked but when I archive my app I have to delete both and add this code to my pod file and run pod install :

 pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'DevSupport',
    'CxxBridge',
    'RCTNetwork'
 ]

Otherwise I have errors. I also upgrade react-native to 55.3 from 51.

I've also found that when archiving, the libRCT*.a libraries need to be removed from Link Binary With Libraries. Otherwise the archive generation complains about duplicate symbols. I'm using pods as per the RN project setup instructions.

Regular debug & release builds need the libRCT*.a libraries, but archiving can't have those which puts us in a bind.

me too in [email protected]

Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.55?

Thank you for your contributions.

Dear Mr bot,

This occurs with RN 0.55.3 and probably any newer version.

same with me in [email protected]

So what is the solution then ?

@frayhan32 For now it's not the best solution, but to avoid the warning we can ignore it:

import { YellowBox } from 'react-native';
YellowBox.ignoreWarnings(['Class RCTCxxModule']);

I haven't proven my theory but I just started getting this (and another warning: "RCTImageLoader requires main queue setup...") and the only change I made was to use YellowBox (as per prev comment) instead of the old console.ignoredYellowBox method.

@charlot567 Note that same method is used to prevent the "isMounted(...) is deprecated" yellow box appear in
https://github.com/react-navigation/react-navigation/issues/3956
They persist in [email protected]

This is a duplicate of #14806 so I'll close and lock this to avoid spam/useless comments

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DreySkee picture DreySkee  路  3Comments

axelg12 picture axelg12  路  3Comments

janmonschke picture janmonschke  路  3Comments

madwed picture madwed  路  3Comments

josev55 picture josev55  路  3Comments