Closed arturmusin closed 2 years ago
@arturmusin, are you using expo?
@Rapsssito I have experienced the same described issue that @arturmusin is having, on an expo ejected project.
It might be an issue with expo new ejected project. Have you tested with the cache cleared? What RN version are you using?
Hi @Rapsssito,
I restarted the expo
project and this issue resolved. But the expo
threw an exception of Native module cannot be null. Is there any solution to make react-native-tcp-socket
in an expo
project?
Invariant Violation: Native module cannot be null.
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 [native code]:null in flushedQueue
at [native code]:null in invokeCallbackAndReturnFlushedQueue
Unable to start your application. Please refer to https://expo.fyi/no-registered-application for more information.
at node_modules/react-native/Libraries/ReactNative/AppRegistry.js:200:6 in runApplication
at [native code]:null in callFunctionReturnFlushedQueue
Thank you so much in advanced!
@Lawjune, I am not familiar with expo, but as far as I know you cannot run any module with native code without "ejecting" your project first. Maybe someone with more experience with expo can help you.
@Rapsssito, thank you so much all the same. It's an expo
issue existing for years since https://expo.canny.io/feature-requests/p/support-raw-tcp-sockets. Eventually I use the RN CLI to make it work. Thanks again!
Hi, I've been struggling with this issue over a week. I create empty react-native application for MacOS and install "react-native-tcp-socket" package. When I try to use this library in my project I get "Error: Requiring module "node_modules/react-native-tcp-socket/src/index.js", which threw an exception: Invariant Violation: Native module cannot be null."
Could anyone please help me with that? I'm bashing my head against this wall over a week already...
` import React, { Component } from 'react'; import {Text,View} from 'react-native';
const tcpSocket = require('react-native-tcp-socket');
class App extends Component { render() { return (
} }
export default App; `