Comments (40)
Any solution with auto-linking on react-native 0.61.1? The same issue coming.
from react-native-netinfo.
I installed the most recent version (2.0.3) and went back and installed 2.0.2 (npm install --save @react-native-community/[email protected]
) and I am getting the same error. Is there anything I may be missing?
from react-native-netinfo.
@ryekerjh Hey!
I have installed version 2.0.2 and linked it again using react-native link @react-native-community/netinfo
that linked it successfully but didn't work while I was building the app from xcode.
So I manually dragged RNCNetInfo.xcodeproj (which is located at node_modules/@react-native-community/netinfo/ios/RNCNetInfo.xcodeproj) into root of xcode project. And after that go to build phase in xcode and click Link binary with libraries and add libRNCNetInfo.a
there. That worked for me
from react-native-netinfo.
Same problem here with react-native 0.61.5. Unable to use this module with auto-linking.
from react-native-netinfo.
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
from react-native-netinfo.
@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!
from react-native-netinfo.
I am using
"react-native": "0.62.2",
"@react-native-community/netinfo": "^5.9.2",
distributionUrl=https://services.gradle.org/distributions/gradle-6.5-all.zip
I am getting this error "NativeModule.RNCNetInfo is null" in android
I tried with manual linking no use.
Anyone, please help
from react-native-netinfo.
👋 Thanks for reporting this. I have an idea what this is and will work to have a fix out by tomorrow
from react-native-netinfo.
🎉 This issue has been resolved in version 2.0.2 🎉
The release is available on:
Your semantic-release bot 📦🚀
from react-native-netinfo.
@matt-oakes I just installed 2.0.2
and it works, thanks for the fast fix!
from react-native-netinfo.
@guptayash Also worked for me. Libraries--RCTNetInfo.xcodeproj--Products--libRNCNetInfo.a drag to targets--Build Phases --Link Binary With Libraries.
from react-native-netinfo.
@matt-oakes Oh I did not see the manual, thanks, that was the problem. Havent linked properly!
from react-native-netinfo.
@ngoctan95 This is working if you have the library linked correctly. If you search for RNCNetInfo
in the issues there are already lots of discussions for the different scenarios where linking was not performed correctly. It's 99% certain that your issue is one of those. Take a look through them and if it really isn't one of those, open a new issue with as much information as you can, including why it's not any of the previously mentioned issues.
https://github.com/react-native-community/react-native-netinfo/issues?utf8=✓&q=RNCNetInfo
from react-native-netinfo.
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".
from react-native-netinfo.
I recommend unlink everything that you do manually related this dependency and add the following line in your Podfile.
pod 'react-native-netinfo', :path => '../node_modules/@react-native-community/netinfo'
Then pod install and it should work.
from react-native-netinfo.
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.
from react-native-netinfo.
This issue still has I'm testing on android 9.
from react-native-netinfo.
Yeap, 2.0.1
has this bug, 2.0.0
works fine.
from react-native-netinfo.
Thanks for fixing!
from react-native-netinfo.
@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.
from react-native-netinfo.
@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.
from react-native-netinfo.
@matt-oakes Thanks for the quick response! I did rebuild (shut down the server, wiped the emulator, closed the terminal and ran react-native run-ios
from scratch.) I also ran the link command again, but same error.
from react-native-netinfo.
@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
from react-native-netinfo.
Same issue with me. Unable to solve it with new update(@2.0.2)
from react-native-netinfo.
@guptayash after installing and linking, are you trying to clean and build the project in XCode? If so, are you getting any errors?
from react-native-netinfo.
@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.
from react-native-netinfo.
2.0.10 still has the bug. Linking didn't help at all
from react-native-netinfo.
@SourceCipher Can you send over:
- Contents of your .gradle files
- Contents of your
MainApplication.java
- Screenshot of your iOS linked libraries
If you are running the react-native link
command, it's likely that it's only partly completed. The most likely place that it's failed in in adding the module to the android MainApplication.java
. Double check that and follow the instructions for manual linking to double check.
from react-native-netinfo.
@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 MainApplication
was not changed at all after linking so it must be the case that it was not added to the MainApplication
from react-native-netinfo.
@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 MainApplication
was not changed, then that is your issue.
from react-native-netinfo.
same issue. @matt-oakes . ios and android manual linking. but not work in release. crash app. it is maybe critical bug,
from react-native-netinfo.
@LucaKIN: I'm not building for iOS nor I'm on Mac
from react-native-netinfo.
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.
info Fetching system and libraries information...
System:
OS: macOS Mojave 10.14.6
CPU: (4) x64 Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
Memory: 129.51 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.16.0 - /usr/local/bin/node
npm: 6.13.2 - /usr/local/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
API Levels: 23, 26, 27, 28, 29
Build Tools: 26.0.2, 28.0.3, 29.0.1
System Images: android-29 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.6010548
Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
npmPackages:
react: ~16.9.0 => 16.9.0
react-native: ~0.61.4 => 0.61.4
npmGlobalPackages:
react-native-cli: 2.0.1
from react-native-netinfo.
@mikehardy you were right, the line require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
was missing from my Podfile. use_unimodules!
was in the Podfile though.
I tried adding the missing line to the Podfile, cleared node_modules
and ran npm install
and pod install
, but my Podfile didn't change and the NetInfo pod still didn't install without linking manually. Should Podfile be modified automatically after installing the NetInfo npm package?
Here is my original Podfile for reference:
platform :ios, '10.0'
require_relative '../node_modules/react-native-unimodules/cocoapods'
target 'Waves' do
rnPrefix = "../node_modules/react-native"
# React Native and its dependencies
pod 'FBLazyVector', :path => "#{rnPrefix}/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "#{rnPrefix}/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "#{rnPrefix}/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "#{rnPrefix}/Libraries/TypeSafety"
pod 'React', :path => "#{rnPrefix}/"
pod 'React-Core', :path => "#{rnPrefix}/"
pod 'React-CoreModules', :path => "#{rnPrefix}/React/CoreModules"
pod 'React-RCTActionSheet', :path => "#{rnPrefix}/Libraries/ActionSheetIOS"
pod 'React-RCTAnimation', :path => "#{rnPrefix}/Libraries/NativeAnimation"
pod 'React-RCTBlob', :path => "#{rnPrefix}/Libraries/Blob"
pod 'React-RCTImage', :path => "#{rnPrefix}/Libraries/Image"
pod 'React-RCTLinking', :path => "#{rnPrefix}/Libraries/LinkingIOS"
pod 'React-RCTNetwork', :path => "#{rnPrefix}/Libraries/Network"
pod 'React-RCTSettings', :path => "#{rnPrefix}/Libraries/Settings"
pod 'React-RCTText', :path => "#{rnPrefix}/Libraries/Text"
pod 'React-RCTVibration', :path => "#{rnPrefix}/Libraries/Vibration"
pod 'React-Core/RCTWebSocket', :path => "#{rnPrefix}/"
pod 'React-Core/DevSupport', :path => "#{rnPrefix}/"
pod 'React-cxxreact', :path => "#{rnPrefix}/ReactCommon/cxxreact"
pod 'React-jsi', :path => "#{rnPrefix}/ReactCommon/jsi"
pod 'React-jsiexecutor', :path => "#{rnPrefix}/ReactCommon/jsiexecutor"
pod 'React-jsinspector', :path => "#{rnPrefix}/ReactCommon/jsinspector"
pod 'ReactCommon/jscallinvoker', :path => "#{rnPrefix}/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "#{rnPrefix}/ReactCommon"
pod 'Yoga', :path => "#{rnPrefix}/ReactCommon/yoga"
pod 'DoubleConversion', :podspec => "#{rnPrefix}/third-party-podspecs/DoubleConversion.podspec"
pod 'glog', :podspec => "#{rnPrefix}/third-party-podspecs/glog.podspec"
pod 'Folly', :podspec => "#{rnPrefix}/third-party-podspecs/Folly.podspec"
# Other native modules
pod 'RNGestureHandler', :podspec => '../node_modules/react-native-gesture-handler/RNGestureHandler.podspec'
pod 'RNReanimated', :podspec => '../node_modules/react-native-reanimated/RNReanimated.podspec'
pod 'RNScreens', :path => '../node_modules/react-native-screens'
# Automatically detect installed unimodules
use_unimodules!
end
from react-native-netinfo.
@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'
from react-native-netinfo.
If anyone still facing this problem, I have resolved it by installing the required library by running:
yarn add @react-native-community/netinfo
and it's working now. For:
"react-native": 0.61.2
"react-native-offline": "^5.2.0",
from react-native-netinfo.
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 import { CustomeButton } from '../index'
to import CustomeButton from '../CustomeButton'
(ie directly from the file, without an intermediate index file).
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).
from react-native-netinfo.
This issue still has I'm testing on android 9.
have you fixed this issue in android?
from react-native-netinfo.
ios fix for me:
cd ios
rm Podfile.lock
pod install
cd ..
react-native run-ios
from react-native-netinfo.
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 (npx react-native-clean-project
might help) or a few other things but it is NOT the module's fault. You need to fix your project, then it will work
from react-native-netinfo.
Related Issues (20)
- Execution failed for task `:react-native-community_netinfo:compileReleaseJavaWithJavac`. HOT 1
- "SSID, BSSID, IP" not compliant with Huawei App market Policies HOT 4
- getting logout/crash application when switch the network HOT 1
- Can't get wifi ssid on IOS HOT 1
- I keep getting this error when i install the package, how can i fix it HOT 4
- isInternetReachable returns true while there is no data connection but my wifi is on and connected HOT 5
- let me explain clearly I connected my device to another device's hotspot and the device I connected to has no access to the internet however Netinfo.isInternetReachable returns true. HOT 1
- Fix TypeSafety for useNetInfo hook results
- NetworkCallbackConnectivityReceiver.register android.net.ConnectivityManager$TooManyRequestsException HOT 12
- Execution failed for task ':react-native-community_netinfo:compileDebugJavaWithJavac' HOT 8
- Invalid hook call
- NetInfo Library: isConnected Value Not Updating After Reconnecting to Internet HOT 5
- errors as a when using the netinfo fetch command when I had a javascript fetch in my component HOT 1
- Can I get MAC Address on both platform? HOT 1
- Error: @react-native-community/netinfo: NativeModule.RNCNetInfo is null. HOT 1
- Internet Connectivity Check Not Triggering When App is Killed - @react-native-community/netinfo HOT 1
- Possible no hotspot management
- Task :app:lintAnalyzeDebug FAILED when gradle build HOT 2
- Default Gateway IP
- Possible issue during gradlew assembleRelease for netinfo library checks HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-netinfo.