invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.63k stars 2.2k forks source link

libc.so unknown crashes in firebase Crashlytics dashboard in my production #4508

Closed mohamed-ikram closed 3 years ago

mohamed-ikram commented 3 years ago

Hello I have migrated rn-firebase to "@react-native-firebase/app": "^8.4.6", "@react-native-firebase/crashlytics": "^8.3.0"

in firebase Crashlytics dashboard crashes have issues shows libc.so unknown with the help of logs I tried to reproduce the crashes cant able to do that anyone please explain what does it mean or any way to fix the crashes I have received more than 200 crash events for a single day Screenshot (41)_LI

mikehardy commented 3 years ago

It's some native crash, there are some related reports here and last I know is that @AndrewMorsillo was going to try to get something cooked up with native symbolication so these were more decodable, https://github.com/invertase/react-native-firebase/issues/4253#issuecomment-707895559 - but it's not an easy task and I'm not sure if there is any progress. In the end this isn't a react-native-firebase problem per se, you've got a crash somewhere in your app and it's just that crashlytics isn't giving you enough information to find it because of the way react-native is built and packaged - that's out of our control unfortunately

I see these in my app as well, but I don't have any action to take, I suggest following that issue I linked

tiggem1993 commented 3 years ago

@mohamed-ikram Can you share your dependencies list from package.json? I am also facing lots of libc.so crashes and after googling I have found one third party dependency is making these crashes. These crashes are not reproducible under fix number of steps. I have created two build for test with and without those dependency and found My app was not crashing without that dependency.

mohamed-ikram commented 3 years ago

@tiggem1993 my dependencies


    "@react-native-community/art": "^1.2.0",
    "@react-native-community/async-storage": "^1.10.0",
    "@react-native-community/datetimepicker": "^3.0.4",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-community/netinfo": "^5.8.1",
    "@react-native-community/picker": "^1.6.6",
    "@react-native-community/push-notification-ios": "^1.7.1",
    "@react-native-community/toolbar-android": "0.1.0-rc.2",
    "@react-native-firebase/analytics": "^7.4.1",
    "@react-native-firebase/app": "^8.4.7",
    "@react-native-firebase/auth": "^9.2.0",
    "@react-native-firebase/crashlytics": "^8.3.0",
    "@react-native-firebase/dynamic-links": "^7.5.11",
    "@react-native-firebase/messaging": "^7.9.1",
    "@react-navigation/bottom-tabs": "^5.11.1",
    "@react-navigation/drawer": "^5.11.3",
    "@react-navigation/native": "^5.8.9",
    "@react-navigation/stack": "^5.12.6",
    "axios": "^0.21.0",
    "babel-preset-react-native": "^4.0.1",
    "error-ex": "git+https://github.com/Qix-/node-error-ex.git",
    "formik": "^2.1.4",
    "jetifier": "^1.6.5",
    "lottie-ios": "^3.1.8",
    "lottie-react-native": "^3.2.2",
    "patch-package": "^6.2.2",
    "payu-non-seam-less-react": "^2.1.0",
    "react": "^16.13.1",
    "react-native": "^0.63.3",
    "react-native-aes-crypto": "^1.3.10",
    "react-native-amplitude-analytics": "^0.2.7",
    "react-native-animatable": "^1.3.3",
    "react-native-camera": "^3.24.2",
    "react-native-cn-richtext-editor": "^1.0.42",
    "react-native-confetti-view": "^1.0.0",
    "react-native-confirmation-code-field": "^6.5.1",
    "react-native-device-info": "^7.0.2",
    "react-native-document-picker": "^4.1.0",
    "react-native-fbsdk": "^3.0.0",
    "react-native-file-download": "0.0.10",
    "react-native-file-viewer": "^2.1.1",
    "react-native-fs": "^2.16.6",
    "react-native-gesture-handler": "^1.6.1",
    "react-native-get-real-path": "git+https://github.com/Wraptime/react-native-get-real-path.git",
    "react-native-google-analytics-bridge": "^7.1.0",
    "react-native-image-crop-picker": "^0.35.1",
    "react-native-image-picker": "^2.3.3",
    "react-native-in-app-review": "^2.1.8",
    "react-native-keyboard-aware-scroll-view": "^0.9.2",
    "react-native-kommunicate-chat": "^1.0.9",
    "react-native-masked-text": "^1.13.0",
    "react-native-mixpanel": "^1.2.5",
    "react-native-modal-datetime-picker": "^9.0.0",
    "react-native-orientation": "^3.1.3",
    "react-native-pell-rich-editor": "^1.3.0",
    "react-native-permissions": "^2.2.2",
    "react-native-popup-menu": "^0.15.7",
    "react-native-progress": "^4.1.2",
    "react-native-push-notification": "^6.1.2",
    "react-native-qrcode-scanner": "github:moaazsidat/react-native-qrcode-scanner#refs/pull/202/head",
    "react-native-ratings": "^7.2.0",
    "react-native-reanimated": "^1.8.0",
    "react-native-render-html": "^4.2.3",
    "react-native-render-html-table-bridge": "^0.6.1",
    "react-native-safe-area-context": "^3.1.9",
    "react-native-safe-area-view": "^1.1.1",
    "react-native-screens": "^2.7.0",
    "react-native-share": "^4.0.4",
    "react-native-signature-canvas": "^3.2.0",
    "react-native-simple-toast": "^1.1.3",
    "react-native-sms-retriever": "^1.1.1",
    "react-native-snap-carousel": "^3.9.0",
    "react-native-splash-screen": "^3.2.0",
    "react-native-storage": "^1.0.1",
    "react-native-tab-view": "^2.14.4",
    "react-native-url-polyfill": "^1.1.2",
    "react-native-vector-icons": "^7.0.0",
    "react-native-version-check": "^3.4.1",
    "react-native-video": "^5.0.2",
    "react-native-webengage": "^1.1.1",
    "react-native-webview": "^10.3.2",
    "rn-fetch-blob": "^0.12.0",
    "rn-range-slider": "^1.3.2",
    "smartlook-react-native-wrapper": "^0.37.0",
    "yup": "^0.29.3"
  },```
tiggem1993 commented 3 years ago

@mohamed-ikram This might be culprit "smartlook-react-native-wrapper": "^0.37.0". So many peoples are facing libc.so related crash after implementing it. See the below links. https://github.com/smartlook/smartlook-mobile-issue-tracker/issues/28 https://github.com/smartlook/smartlook-mobile-issue-tracker/issues/53

Even I have seen Smartlook team is still trying to fix this issue: IMPORTANT LINK https://github.com/smartlook/smartlook-mobile-issue-tracker/issues/28#issuecomment-732028043

Please cross check with your Firebase Crshlytics logs. Also make a build without smartlook and test it. I am sure it should not crash.

mohamed-ikram commented 3 years ago

thanks @tiggem1993 ill check and let u know

tiggem1993 commented 3 years ago

Hi @mohamed-ikram , Have you checked? please let us know.

I have upgraded my "smartlook-react-native-wrapper" from 0.31.0 to 0.39.0 and found now crashes occurring in Android 7 only. So I did research and found Android team said in its Android 7 release that they prevents our apps from dynamically linking against non-NDK libraries, which may cause our app to crash. Same they also prevent our app's third party libraries to linking with non-NDK libraries.

So we are now finding is libc.so belongs from non-NDK library file? If yes then how include in our project to prevent crash.

We also trying to find a method about how to check which dependency is using this libc.so file? And how to fix it.

Please help us. @mikehardy @mohamed-ikram

githubbla commented 3 years ago

Hi @mohamed-ikram , Have you checked? please let us know.

I have upgraded my "smartlook-react-native-wrapper" from 0.31.0 to 0.39.0 and found now crashes occurring in Android 7 only. So I did research and found Android team said in its Android 7 release that they prevents our apps from dynamically linking against non-NDK libraries, which may cause our app to crash. Same they also prevent our app's third party libraries to linking with non-NDK libraries.

So we are now finding is libc.so belongs from non-NDK library file? If yes then how include in our project to prevent crash.

We also trying to find a method about how to check which dependency is using this libc.so file? And how to fix it.

Please help us. @mikehardy @mohamed-ikram

Did you found other way to build to prevent frequent crashes in Android 7?

kavishmehta commented 3 years ago

@tiggem1993 can you also look into my project dependences as I m also getting same issue:

"dependencies": { "@formatjs/intl-locale": "^2.4.8", "@formatjs/intl-pluralrules": "^4.0.0", "@react-native-clipboard/clipboard": "^1.7.0", "@react-native-community/async-storage": "^1.6.1", "@react-native-community/progress-bar-android": "^1.0.3", "@react-native-community/progress-view": "^1.2.2", "@react-native-community/push-notification-ios": "^1.7.1", "@react-native-firebase/analytics": "^7.6.9", "@react-native-firebase/app": "^8.4.7", "@react-native-firebase/crashlytics": "^8.4.12", "@react-native-firebase/messaging": "^7.9.2", "@react-native-firebase/perf": "^7.4.10", "@sentry/react-native": "^2.4.0", "axios": "0.18.1", "http-proxy": "1.17.0", "https-proxy-agent": "^3.0.0", "immutability-helper": "^3.0.2", "intl": "^1.2.5", "jail-monkey": "^2.3.2", "jsc-android": "^241213.1.0", "lodash": "4.17.15", "moment": "2.24.0", "prop-types": "^15.7.2", "react": "16.9.0", "react-content-loader": "^6.0.2", "react-intl": "^5.10.6", "react-native": "0.61.2", "react-native-calendars": "1.212.0", "react-native-check-box": "^2.1.7", "react-native-code-push": "^5.7.0", "react-native-config": "^1.4.2", "react-native-contacts": "^5.1.0", "react-native-device-info": "^7.4.0", "react-native-document-picker": "^3.5.4", "react-native-draggable-flatlist": "^2.1.2", "react-native-flags": "1.0.0", "react-native-geolocation-service": "^5.3.0-beta.1", "react-native-gesture-handler": "^1.4.1", "react-native-i18n": "^2.0.14", "react-native-image-picker": "1.1.0", "react-native-image-resizer": "^1.1.0", "react-native-keyboard-aware-scroll-view": "0.9.1", "react-native-linear-gradient": "2.4.0", "react-native-maps": "0.27.1", "react-native-month-selector": "^1.4.0", "react-native-pdf": "^6.2.2", "react-native-push-notification": "7.3.1", "react-native-qrcode-svg": "^6.0.6", "react-native-reanimated": "^1.2.0", "react-native-render-html": "^4.2.4", "react-native-screens": "^1.0.0-alpha.23", "react-native-signature-capture": "^0.4.10", "react-native-snap-carousel": "^3.9.0", "react-native-splash-screen": "^3.2.0", "react-native-svg": "9.9.4", "react-native-swipe-gestures": "^1.0.5", "react-native-user-avatar": "^1.0.7", "react-native-uuid": "^2.0.1", "react-native-vector-icons": "6.6.0", "react-native-video": "^4.4.4", "react-native-webview": "^10.3.3", "react-navigation": "^4.0.8", "react-navigation-drawer": "^2.2.2", "react-navigation-stack": "^1.9.0", "react-navigation-tabs": "^2.5.5", "react-redux": "7.1.1", "redux": "4.0.4", "redux-logger": "3.0.6", "redux-persist": "6.0.0", "redux-thunk": "2.2.0", "rn-fetch-blob": "^0.12.0", "victory-native": "^33.0.0" }, "devDependencies": { "@babel/core": "^7.6.2", "@babel/runtime": "^7.6.2", "@react-native-community/eslint-config": "^0.0.5", "@storybook/addon-actions": "5.2.8", "@storybook/addon-knobs": "5.2.8", "@storybook/addon-links": "5.2.8", "@storybook/addon-ondevice-knobs": "5.2.8", "@storybook/addons": "5.2.8", "@storybook/react-native": "5.2.8", "@storybook/react-native-server": "^5.2.8", "babel-eslint": "^10.0.3", "babel-jest": "^24.9.0", "babel-loader": "^8.0.6", "babel-plugin-transform-remove-console": "^6.9.4", "babel-preset-react-native": "4.0.0", "eslint": "^6.8.0", "eslint-config-airbnb": "^18.0.1", "eslint-plugin-import": "^2.19.1", "eslint-plugin-jsx-a11y": "^6.2.3", "eslint-plugin-react": "^7.17.0", "eslint-plugin-react-native": "^3.8.1", "jest": "^24.9.0", "metro-react-native-babel-preset": "^0.56.0", "prettier": "^1.19.1", "react-dom": "^16.9.0", "react-test-renderer": "16.9.0" },

mikehardy commented 3 years ago

@kavishmehta spending any time at all troubleshooting when your software is not up to date is incredibly inefficient, I don't even try. Update to current stable on your packages in all cases unless you have specific known incompatibilities then attempt to reproduce


"@react-native-firebase/analytics": "^7.6.9",
"@react-native-firebase/app": "^8.4.7",
"@react-native-firebase/crashlytics": "^8.4.12",
"@react-native-firebase/messaging": "^7.9.2",
"@react-native-firebase/perf": "^7.4.10",

How old are these now? Quite old.

kavishmehta commented 3 years ago

thanks @mikehardy will update the required packages

cozmoc commented 3 years ago

been able to find a solution, for me the issue was mainly caused by the inconsistent behaviour of date.toLocaleDateString function on Android. https://stackoverflow.com/a/51400372 the easiest solution I could find is to replace toLocaleDateString everywhere in the app with a custom made version.

const toLocaleDateString = date => `${date.getDate()}/${date.getMonth() < 9 ? `0${date.getMonth() + 1}` : date.getMonth() + 1}/${date.getFullYear()}`;

nikhilk1993 commented 2 years ago

Any updates on this? facing the same error..

mikehardy commented 2 years ago

There will not be updates on a closed issue from nearly a year go based on a comment now with no versions or stack traces specified, no, sorry

If you get a crash in "libc.so" you've got a crash, but it likely has nothing to do with firebase or our crashlytics module. You just have some random crash in your app, I don't believe there is anything this module can do actually.

If you can post a stack trace that has a crash with a stack frame directly in this module, then we have an issue that needs attention here: that's the criteria. If you look at the original crash for instance, RNFetchBlob looks like it blew up. Nothing to do with react-native-firebase...

badredaha commented 2 years ago

The same thing here :/