Comments (12)
same issue
most in Android 10 and Android 12
from react-native-netinfo.
Have you solved it? @AuroPick
from react-native-netinfo.
We are also experiencing same crash only in Android 13. @AuroPick Did you solved it?
I checked the code we already have try..catch
block in requestNetwork
function which will safeguard app crash. But since this exception is thrown from ConnectivityManger
which is a part of android framework. We need to find in what case TooManyRequest
are sent. And that too only in Android 13.
from react-native-netinfo.
I am able to repro this crash on sample Android App by calling registDefaultNetwork function 101 times.
for (i in 0..101) { // Adjust the loop count as necessary to trigger the exception
try {
connectivityManager.registerDefaultNetworkCallback(object : NetworkCallback() {
override fun onAvailable(network: Network) {
Log.d(TAG, "Network available: iteration $i $network")
}
})
} catch (e: java.lang.Exception) {
Log.e(TAG, "Request failed at iteration $i", e)
break
}
}
It breaks with same stack trace on 99th iteration.
Then I checked net info code here we are calling connectivityManager.registerDefaultNetworkCallback
code in register
method which is begin called from initialise
method.
initialize
method is overriden method from ReactContextBaseJavaModule
. Which will be called when NativeModule is being initialzed.
So far this is my findings let us know if anyone finds anything.
from react-native-netinfo.
One solution we might try is by ensuring that the module is initialised only once across all instances.
Something like this
@Override
public synchronized void initialize() {
super.initialize();
if (isInitialized) {
Log.d(TAG, "NetInfoModule already initialized");
return;
}
Log.d(TAG, "NetInfoModule initializing");
isInitialized = true;
register();
}
from react-native-netinfo.
Related Issues (20)
- Sending request problem HOT 6
- NetInfo.configure is not working, HOT 3
- ID of the CellTower in use HOT 1
- 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
- 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
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.