newrelic / newrelic-react-native-agent

New Relic Mobile Agent SDK for React-Native Applications
Apache License 2.0
14 stars 24 forks source link

New Relic detected an unrecognized selector, 'reanimated_viewDidLayoutSubviews', sent to 'UIViewController'. It's possible _cmd was renamed by an unsafe method_exchangeImplementations().' #159

Open panchal-krunal opened 2 months ago

panchal-krunal commented 2 months ago

I have installed newrelic-react-native-agent (1.3.7) in my project and started getting run time error as below -

New Relic detected an unrecognized selector, 'reanimated_viewDidLayoutSubviews', sent to 'UIViewController'. It's possible _cmd was renamed by an unsafe method_exchangeImplementations().'

I am not at all sure what package is causing this issue, seems to be react-native-reanimated with the error, but not sure if it is only causing the issue. I tried with older versions of newrelic-react-native-agent but doesn't work.

I have below packages installed in my project -

          "@react-native-community/netinfo": "^11.1.1",
    "@react-native-community/push-notification-ios": "^1.11.0",
    "@react-native-firebase/app": "^18.6.2",
    "@react-native-firebase/auth": "^18.6.2",
    "@react-native-firebase/messaging": "^18.6.2",
    "@react-native-masked-view/masked-view": "^0.2.9",
    "@react-native-picker/picker": "^2.5.1",
    "@react-navigation/bottom-tabs": "^6.5.9",
    "@react-navigation/native": "^6.1.7",
    "@react-navigation/stack": "^6.3.17",
    "@reduxjs/toolkit": "^1.9.5",
    "@rudderstack/rudder-sdk-react-native": "^1.11.1",
    "axios": "^1.5.1",
    "i18next": "^23.2.3",
    "jwt-decode": "3.1.2",
    "lodash": "^4.17.21",
    "moment": "^2.29.4",
    "moment-timezone": "^0.5.43",
    "newrelic-react-native-agent": "1.3.7",
    "patch-package": "^8.0.0",
    "path-to-regexp": "^6.2.1",
    "react": "18.2.0",
    "react-i18next": "^13.0.1",
    "react-native": "0.72.1",
    "react-native-app-auth": "^7.1.3",
    "react-native-calendars": "^1.1301.0",
    "react-native-date-picker": "^4.3.3",
    "react-native-device-info": "^10.11.0",
    "react-native-gesture-handler": "^2.12.0",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-linear-gradient": "^2.8.3",
    "react-native-localize": "^3.0.4",
    "react-native-mask-input": "^1.2.3",
    "react-native-media-controls": "^2.3.0",
    "react-native-mmkv": "^2.10.2",
    "react-native-mmkv-flipper-plugin": "^1.0.0",
    "react-native-orientation-locker": "^1.6.0",
    "react-native-pager-view": "^6.2.2",
    "react-native-permissions": "^4.1.1",
    "react-native-picker-select": "^8.1.0",
    "react-native-progress-steps": "^1.3.4",
    "react-native-push-notification": "^8.1.1",
    "react-native-ratings": "^8.1.0",
    "react-native-reanimated": "^3.3.0",
    "react-native-safe-area-context": "^4.7.2",
    "react-native-screens": "^3.22.0",
    "react-native-scrollable-tab-view": "ptomasroos/react-native-scrollable-tab-view#master",
    "react-native-size-matters": "^0.4.2",
    "react-native-slider": "^0.11.0",
    "react-native-svg": "^13.14.0",
    "react-native-switch-selector": "^2.3.0",
    "react-native-tab-view": "^3.5.2",
    "react-native-toast-notifications": "^3.4.0",
    "react-native-vector-icons": "^10.0.0",
    "react-native-video": "^5.2.1",
    "react-native-webview": "^13.6.2",
    "react-redux": "^8.1.1",
    "redux-persist": "^6.0.0",
    "redux-persist-transform-filter": "^0.0.22"
MikeMifel commented 1 month ago

I had the same error with "newrelic-react-native-agent": "1.3.7",

I solved with setting the value of interactionTracingEnabled to false, interactionTracingEnabled: false

https://forum.newrelic.com/s/hubtopic/aAXPh0000000sA5OAI/application-crash-on-ios https://knowledge.newrelic.com/s/article/Fatal-Exception-NSInvalidArgumentException

I hope it helps you!

LcsGrz commented 1 month ago

Same here, any news?

ndesai-newrelic commented 1 month ago

@LcsGrz can you check this? https://knowledge.newrelic.com/s/article/Fatal-Exception-NSInvalidArgumentException

Samykills commented 1 month ago

@ndesai-newrelic is there a way to fix this? reanimated is a package that is core to most parts of the app, including navigation and animations, removing reanimated is not an option for my app.

ndesai-newrelic commented 1 month ago

@Samykills can you add this in agent configuration when you start the agent interactionTracingEnabled: false ?

Samykills commented 1 month ago

@Samykills can you add this in agent configuration when you start the agent interactionTracingEnabled: false ?

even when i do add this on JS, the initialisation of the reanimated lib takes place natively at app start since its not turbo modules yet, thus as soon as we start the agent, we get the same error, however i figured, if i disable this natively before agent start func is run then it works fine.

  [NewRelic disableFeatures:NRFeatureFlag_InteractionTracing];
  [NewRelic startWithApplicationToken: @"appkey"];
Samykills commented 4 weeks ago

@ndesai-newrelic this should remain, open till u guys fix it, the workaround i found is not the recommended one, as it will bypass the values being set by JS methods

ndesai-newrelic commented 4 weeks ago

@Samykills we will look into it.