'Every time that I import RtcEngine into my application (import RtcEngine from 'react-native-agora';) I get the following error:

** TypeError: null is not an object (evaluating 'AgoraRtcChannelModule.prefix') at node_modules\react-native\Libraries\LogBox\LogBox.js:148:8 in registerError at node_modules\react-native\Libraries\LogBox\LogBox.js:59:8 in errorImpl at node_modules\react-native\Libraries\LogBox\LogBox.js:33:4 in console.error at node_modules\expo\build\environment\react-native-logs.fx.js:27:4 in error at node_modules\react-native\Libraries\Core\ExceptionsManager.js:104:6 in reportException at node_modules\react-native\Libraries\Core\ExceptionsManager.js:171:19 in handleException at node_modules\react-native\Libraries\Core\setUpErrorHandling.js:24:6 in handleError at node_modules\expo-error-recovery\build\ErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0 at node_modules@babel\runtime\node_modules\regenerator-runtime\runtime.js:62:36 in tryCatch at node_modules@babel\runtime\node_modules\regenerator-runtime\runtime.js:288:29 in invoke at node_modules@babel\runtime\node_modules\regenerator-runtime\runtime.js:62:36 in tryCatch at node_modules@babel\runtime\node_modules\regenerator-runtime\runtime.js:152:27 in invoke at node_modules@babel\runtime\node_modules\regenerator-runtime\runtime.js:162:18 in Promise.resolve.then$argument_0 at node_modules\react-native\node_modules\promise\setimmediate\core.js:37:13 in tryCallOne at node_modules\react-native\node_modules\promise\setimmediate\core.js:123:24 in setImmediate$argument_0 at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:130:14 in _callTimer at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:181:14 in _callImmediatesPass at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:441:30 in callImmediates at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:387:6 in __callImmediates at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:135:6 in __guard$argument_0 at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:134:4 in flushedQueue at [native code]:null in flushedQueue at [native code]:null in invokeCallbackAndReturnFlushedQueue**



Solution 1:[1]

look like the library is not linked well, try: first console.log the library to see if it you get the import well. second try to do fresh build:

  • clean project
  • delete node_modules
  • yarn
  • check your node version
  • cd ios
  • pod deintegrate
  • pod install
  • sometimes deleting the app and re build it do the magic

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 DharmanBot