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
NativeModule.RNCNetInfo is null #63
Comments
Yeap, |
👋 Thanks for reporting this. I have an idea what this is and will work to have a fix out by tomorrow |
🎉 This issue has been resolved in version 2.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thanks for fixing! |
@mattvaldez No problem! Sorry for the issues. It's because I changed the way the module was packaged and didn't test it fully. I might add a step to CircleCI to catch issues like this, but it's not likely to happen again now it's all set up. Let me know if you have any other issues. |
@matt-oakes I just installed |
I installed the most recent version (2.0.3) and went back and installed 2.0.2 ( |
@ryekerjh Have you rebuilt the native code and rerun the app? You also might need to check that it is liked correctly by running the link command again. |
@matt-oakes Thanks for the quick response! I did rebuild (shut down the server, wiped the emulator, closed the terminal and ran |
@ryekerjh can you open a new issue with the details for a bug report. It's likely that linking is the issue. Can you also let me know in the issue if you're using Cocoapods and the contents of the Podfile and Podfile.lock |
Same issue with me. Unable to solve it with new update(@2.0.2) |
@guptayash after installing and linking, are you trying to clean and build the project in XCode? If so, are you getting any errors? |
@ryekerjh Hey! |
@guptayash In that case, the link command was actually failing. You either have a non-standard project structure that the CLI can't read correctly or there is a bug in the CLI link command. Either way, it's unrelated to this library. |
@guptayash Also worked for me. Libraries--RCTNetInfo.xcodeproj--Products--libRNCNetInfo.a drag to targets--Build Phases --Link Binary With Libraries. |
2.0.10 still has the bug. Linking didn't help at all |
@SourceCipher Can you send over:
If you are running the |
@matt-oakes that was a quick reply! I am not using iOS. Android dont seem to have manual linking guide nor I have seen on the npm docs. From what I can see is that |
@SourceCipher Manual linking guides for both platforms are in the README. Search for "Manually link the library on Android" and click the arrow to expand the instructions. If |
@matt-oakes Oh I did not see the manual, thanks, that was the problem. Havent linked properly! |
same issue. @matt-oakes . ios and android manual linking. but not work in release. crash app. it is maybe critical bug, |
@ngoctan95 This is working if you have the library linked correctly. If you search for https://github.com/react-native-community/react-native-netinfo/issues?utf8=✓&q=RNCNetInfo |
Any solution with auto-linking on react-native 0.61.1? The same issue coming. |
Rebuilding the app again solved the issue for me. Uninstall the app first, run the command "cd android && gradlew clean && cd.." then run "react-native run-android". |
I recommend unlink everything that you do manually related this dependency and add the following line in your Podfile. Then pod install and it should work. |
@LucaKIN: I'm not building for iOS nor I'm on Mac |
Same problem here with react-native 0.61.5. Unable to use this module with auto-linking. |
npx react-native-clean-project clean-project-auto this happens all the time for react-native-device-info (I maintain there) and that command above frequently clears things up (except when it doesn't, but doesn't hurt to try) the module definitely works with auto-linking. |
Unfortunately, I had to link the package manually to get it to work on iOS as well. I have a freshly ejected Expo 36 (React Native 0.61.4) app with the Bare workflow, and I tried the solution above to no avail. Here is my system info; hopefully this helps pin down the issue.
|
Podfile would be more useful, I bet it's missing something like the pair of https://github.com/facebook/react-native/blob/master/template/ios/Podfile#L2 and https://github.com/facebook/react-native/blob/master/template/ios/Podfile#L78 |
@mikehardy you were right, the line I tried adding the missing line to the Podfile, cleared Here is my original Podfile for reference:
|
@emersonhsieh read that second link I sent very carefully https://github.com/facebook/react-native/blob/master/template/ios/Podfile#L78 It does not contain the characters 'unimodules' |
Got it, I'll add those lines manually to the Podfile since Expo did not generate them on ejection. Thank you so much! |
If anyone still facing this problem, I have resolved it by installing the required library by running: and it's working now. For: |
This issue still has I'm testing on android 9. |
So, I feel compelled to tell this because it took me an entire day to figure out how to fix the issue. I was getting this error during unit tests and was somehow able to "fix" the issue by changing my component imports, which were being imported via an index file with I don't know how this fixes anything but I figure it may help for others. The good thing is that it appears I only need to change the import syntax in the test files (and not component source files). |
I am using I am getting this error "NativeModule.RNCNetInfo is null" in android I tried with manual linking no use. Anyone, please help |
have you fixed this issue in android? |
ios fix for me: |
For future people: this is ALWAYS an integration issue. You have not integrated the module correctly somehow. Either auto-linking wasn't implemented correctly in a react-native upgrade, or you did not pod install, or you have cached build artifacts ( |
Environment
Platforms
Versions
Description
Just used yarn to add the package, and I am getting this error. I have followed the instructions suggested in the message. I am not using CocoaPods.
Reproducible Demo
Simply importing the library as described in the README documentation produces the error.
The text was updated successfully, but these errors were encountered: