Closed Sunfocus closed 3 years ago
May be that issue occur because of old version. Updating packages to 10.8.1
working fine. Closing this issue.
14.11.0 and same issue for me... it's a shame unfortunately
@kauesedrez this is not something users report as a general issue, but it is definitely possible for your app to be slow on startup and hang, causing an ANR. It is project-specific in my experience and you'll want to turn on StrictMode and run your app while watching adb logcat in order to properly fix up your app's startup sequence: https://developer.android.com/reference/android/os/StrictMode
@mikehardy I've tested in strict mode and have no issues on adb logcat. To be sure, I make a mistake on purpose and logcat throw the error. So my code doesnt appear have no statup problems. And if you search on google for issues like this you will see how much users have anrs with rn-firebase.
Firebase boots your whole app when it receives a message, so it will be collateral damage for any slow startup issue ever. It's the same as saying 'crashlytics logged a crash so it's crashlytics fault'. I'm not trying to over simplify if you think of it logically it really is the case. The module is fine but sometimes apps boot slowly and boom, you get an anr while app was waking up for an FCM
Firebase boots your whole app when it receives a message, so it will be collateral damage for any slow startup issue ever
Ok, I understand what you are saying, but ANR is a very important metric in Google Play console and my app is flagged with "bad behaviour" and - obviously - my downloads are cut down. So what is your suggestion, do not use notifications any more because ANR is a "collateral damage"?
Ok man, let's say I accept the fact that react-native neither have an official 1.0.0 version yet and sh*t happens...
There are a way to try catch this ANRs or something else? Because its acceptable that some users some times don't receive some notifications, but its not acceptable this behavior impact on google console reports and downloads. Do you understand me?
Please keep it professional.
Note that react-native just uses "magic zero" versioning, it's stable enough, you can google the versioning style.
You'll need to profile your app start up time, there are tools in Android Studio that help you do that, and Firebase Performance module can also help with it. This is a standard phase of app optimization and if you are experiencing ANRs, doing this (similar to my StrictMode advice, to look for StrictMode violations) is important.
Removing notifications will of course result in your app not booting, and if your app doesn't boot then it can't ANR by definition, so it is one way to lower your ANR count. However, if you don't solve whatever is taking your app boot so long then you will likely still have the same number of ANRs-per-boot, right?
This is not a firebase thing unfortunately, it's a generic "my app boots slowly" thing so look for more general advice. Is it only on some device types? Are some network requests made during boot? Disk access? Is the UI thread blocked some times for some reasons? etc
Sorry for my lack of knowledge about 0ver, and congrats on your work in this project. For me, I think it's time to left react and react-native behind and move on.
Thanks for your patience.
Issue
From last few days, I am start getting this error. Whenever I opened the app in android OS, app stuck on white screen, after some time I am getting ANR dialog.
Testing device was Android real device with OS: 9
Details from package.json:
"react": "16.13.1"
"react-native": "^0.64.0"
"@react-native-firebase/app": "^10.4.0"
"@react-native-firebase/auth": "^10.4.0"
"@react-native-firebase/crashlytics": "^10.4.0"
"@react-native-firebase/messaging": "^10.4.0"
Log from android studio: