DataDog / dd-sdk-reactnative

Datadog SDK for ReactNative
Apache License 2.0
115 stars 41 forks source link

android: The environment name should contain maximum 196 of the following allowed characters... #164

Closed finalight closed 2 years ago

finalight commented 2 years ago

Thanks for taking the time for reporting an issue!

Describe what happened

Android crash when opening app in debug mode with datadog RUM

This error does not exists on iOS

Screenshot_1648095898

Steps to reproduce the issue:

Configure the react native with datadog RUM Run the android app in dev mode

Describe what you expected:

I would expect the app to be running without crashing

Additional context "@datadog/mobile-react-native": "^1.0.0-rc4",

package.json

{
  "name": "test",
  "version": "4.1.0",
  "private": true,
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/plugin-proposal-class-properties": "^7.10.4",
    "@babel/plugin-transform-flow-strip-types": "^7.16.7",
    "@babel/preset-typescript": "^7.16.7",
    "@babel/runtime": "^7.12.5",
    "@commitlint/cli": "^16.0.1",
    "@commitlint/config-conventional": "^16.0.0",
    "@faker-js/faker": "^6.0.0-alpha.6",
    "@sentry/cli": "^1.73.2",
    "@testing-library/jest-native": "^4.0.4",
    "@testing-library/react-native": "^9.0.0",
    "@types/jest": "^27.4.1",
    "@types/node": "^17.0.16",
    "@types/react": "^17.0.39",
    "@types/react-dom": "^17.0.11",
    "@types/react-native": "^0.67.2",
    "@types/react-navigation": "^3.4.0",
    "@types/react-redux": "^7.1.22",
    "@types/react-test-renderer": "^17.0.1",
    "@typescript-eslint/eslint-plugin": "^5.11.0",
    "@typescript-eslint/parser": "^5.11.0",
    "@welldone-software/why-did-you-render": "^6.2.1",
    "babel-jest": "^27.5.1",
    "babel-plugin-module-resolver": "^4.1.0",
    "babel-preset-react-native-stage-0": "^1.0.1",
    "detox": "^19.4.3",
    "eslint": "7.21.0",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-jest": "^26.1.1",
    "eslint-plugin-react": "^7.13.0",
    "eslint-plugin-react-hooks": "^4.3.0",
    "eslint-plugin-react-native": "^3.7.0",
    "eslint-plugin-sonarjs": "^0.11.0",
    "eslint_d": "7.3.0",
    "husky": "^7.0.4",
    "jest": "^27.5.1",
    "jest-circus": "^27.5.1",
    "jest-sonar-reporter": "^2.0.0",
    "jetifier": "^1.6.7",
    "lint-staged": "^12.1.7",
    "metro-react-native-babel-preset": "^0.66.2",
    "prettier": "2.2.1",
    "prompts": "^2.4.1",
    "react-devtools": "^4.23.0",
    "react-devtools-core": "^4.23.0",
    "react-native-typescript-transformer": "^1.2.13",
    "react-test-renderer": "17.0.2",
    "standard-version": "^9.3.2",
    "ts-jest": "^27.1.3",
    "tslib": "^2.3.1",
    "typescript": "^4.5.5",
    "xml2js": "^0.4.23"
  },
  "scripts": {
    "android": "react-native run-android",
    "build:android": "react-native bundle --entry-file='index.js' --bundle-output='./android/app/src/main/assets/index.android.bundle' --sourcemap-output='./android/app/src/main/assets/index.android.bundle.map'",
    "build:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --sourcemap-output='./ios/main.jsbundle.map' --dev=false --platform='ios'",
    "bump:build": "bundle exec fastlane bump_build",
    "bump:version": "standard-version --pre-release beta && bundle exec fastlane bump",
    "deploy": "node ./deploy.js",
    "changelog": "standard-version --pre-release beta --skip.bump",
    "ios": "react-native run-ios --simulator=\"iPhone 11 (15.2)\"",
    "ios:small": "react-native run-ios --simulator=\"iPhone SE (2nd generation)\"",
    "lint": "eslint --ext .js --ext .jsx .",
    "postinstall": "patch-package && jetifier",
    "prepare": "husky install",
    "prettier:check": "prettier --check .",
    "prettier:fix": "prettier --write .",
    "react-devtools": "react-devtools",
    "sourcemap:upload": "scripts/upload_sourcemap.sh",
    "start": "NODE_ENV=development react-native start --reset-cache",
    "test": "jest --maxWorkers=50%",
    "test:staged": "jest -o",
    "test:ci": "jest --runInBand",
    "test:watch": "jest --watch",
    "test:coverage": "jest --coverage",
    "test:coverage:summary": "jest --coverage --coverageReporters=\"text-summary\"",
    "e2e:ios-build": "detox build --configuration ios",
    "e2e:ios-test": "detox test --configuration ios"
  },
  "dependencies": {
    "@datadog/mobile-react-native": "^1.0.0-rc4",
    "@datadog/mobile-react-navigation": "^1.0.0-rc4",
    "@react-native-community/async-storage": "1.11.0",
    "@react-native-community/blur": "^3.6.0",
    "@react-native-community/cameraroll": "^4.1.2",
    "@react-native-community/masked-view": "0.1.11",
    "@react-native-community/netinfo": "^7.1.8",
    "@react-native-community/push-notification-ios": "1.8.0",
    "@react-native-firebase/analytics": "11.5.0",
    "@react-native-firebase/app": "11.5.0",
    "@react-native-firebase/iid": "11.5.0",
    "@react-native-firebase/remote-config": "11.5.0",
    "@react-navigation/bottom-tabs": "^6.2.0",
    "@react-navigation/native": "^6.0.8",
    "@react-navigation/stack": "^6.1.1",
    "@reduxjs/toolkit": "^1.8.0",
    "@sentry/react-native": "^3.3.2",
    "@stream-io/flat-list-mvcp": "^0.10.1",
    "@stripe/stripe-react-native": "^0.3.0",
    "appcenter": "4.4.3",
    "appcenter-analytics": "4.4.3",
    "appcenter-crashes": "4.4.3",
    "axios": "^0.26.0",
    "axios-retry": "^3.2.4",
    "eslint": "7.21.0",
    "fbjs": "^3.0.2",
    "formik": "^2.2.9",
    "intl": "^1.2.5",
    "launchdarkly-react-native-client-sdk": "^6.0.0",
    "link-preview-js": "2.1.10",
    "lodash": "4.17.21",
    "mixpanel-react-native": "1.3.7",
    "node-emoji": "1.10.0",
    "patch-package": "^6.4.7",
    "postinstall-postinstall": "^2.1.0",
    "prop-types": "15.7.2",
    "querystring": "0.2.0",
    "react": "17.0.2",
    "react-native": "0.67.2",
    "react-native-android-open-settings": "1.3.0",
    "react-native-appsflyer": "6.2.42",
    "react-native-bootsplash": "3.2.6",
    "react-native-camera": "4.0.0",
    "react-native-circular-progress-indicator": "1.1.2",
    "react-native-communications": "2.2.1",
    "react-native-compressor": "^1.5.2",
    "react-native-currency-input": "^1.0.1",
    "react-native-device-info": "8.3.3",
    "react-native-document-picker": "^8.0.0",
    "react-native-dotenv": "3.3.1",
    "react-native-fast-image": "8.3.2",
    "react-native-flash-message": "github:imouto2005/react-native-flash-message",
    "react-native-flipper": "^0.136.0",
    "react-native-fs": "^2.18.0",
    "react-native-geolocation-service": "5.2.0",
    "react-native-gesture-handler": "2.1.1",
    "react-native-haptic-feedback": "^1.13.0",
    "react-native-image-crop-picker": "^0.37.2",
    "react-native-image-resizer": "^1.4.5",
    "react-native-keyboard-aware-scroll-view": "0.9.3",
    "react-native-linear-gradient": "2.5.6",
    "react-native-localize": "1.4.0",
    "react-native-map-link": "2.7.28",
    "react-native-maps": "^0.30.1",
    "react-native-markdown-renderer": "3.2.8",
    "react-native-modal": "11.10.0",
    "react-native-moengage": "7.1.0",
    "react-native-navbar-color": "1.0.3",
    "react-native-navigation-bar-color": "2.0.1",
    "react-native-paper": "4.11.1",
    "react-native-pdf": "6.2.0",
    "react-native-permissions": "3.1.0",
    "react-native-pure-jwt": "^3.0.0",
    "react-native-push-notification": "7.3.1",
    "react-native-raw-bottom-sheet": "2.2.0",
    "react-native-reanimated": "^2.4.1",
    "react-native-restart": "^0.0.23",
    "react-native-safe-area-context": "^3.3.2",
    "react-native-screens": "3.10.2",
    "react-native-share": "^7.3.3",
    "react-native-svg": "^12.1.1",
    "react-native-url-polyfill": "1.2.0",
    "react-native-vector-icons": "7.0.0",
    "react-native-video": "5.1.1",
    "react-native-video-controls": "2.8.1",
    "react-native-webview": "11.0.0",
    "react-redux": "^7.2.6",
    "react-string-replace": "0.4.4",
    "redux-devtools-extension": "2.13.9",
    "redux-flipper": "^2.0.1",
    "rn-fetch-blob": "0.12.0",
    "rn-intersection-observer": "0.3.0",
    "rn-sliding-up-panel": "2.4.3",
    "stream-chat-react-native": "^3.10.2",
    "url": "0.11.0",
    "use-count-up": "3.0.1",
    "yup": "^0.32.11"
  },
  "lint-staged": {
    "*.{js,css,md}": "prettier --write",
    "*.{js,jsx}": "eslint --cache --fix"
  },
  "standard-version": {
    "skip": {
      "commit": true,
      "tag": true
    },
    "options": {
      "preset": {
        "name": "conventionalchangelog",
        "issuePrefixes": [
          "#"
        ],
        "issueUrlFormat": "https://myBugTracker.com/{{prefix}}{{id}}"
      }
    }
  },
  "resolutions": {
    "react-devtools-core": "4.23.0"
  }
}
0xnm commented 2 years ago

Hello @finalight! Thanks for opening the issue. While the behaviour of iOS SDK vs Android SDK considering the validation of environment is different, the restriction is still valid. Is it possible for you to make environment to be less than 196 characters?

finalight commented 2 years ago

do you mean per enviroment key value or in total?

i have quite a number of enviroment key value, and none of them (the value itself) exceed 196 characters each

and it shouldn't be in total, because if it's in total count; I would have encountered this error long ago.

This error only appears when I integrate datadog SDK in my react native project

0xnm commented 2 years ago

According to the stacktrace shown it is the DdSdkReactNativeConfiguration#env parameter which raises the error: it should comply with the restriction shown. If the value of this parameter complies, but you still get an error, please show us the value (if you don't want to disclose it publicly you can also open a ticket with our support).

0xnm commented 2 years ago

Hello @finalight. I hope that the issue is resolved for you and I'm closing this ticket due to inactivity. Feel free to re-open it if you still experience problems.