Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invariant Violation: [App Name] has not been registered #1329

Open
profaddy opened this issue Aug 21, 2024 · 0 comments
Open

Invariant Violation: [App Name] has not been registered #1329

profaddy opened this issue Aug 21, 2024 · 0 comments

Comments

@profaddy
Copy link

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
We are migrating from RN 0.70.15 -> 0.72.17 and getting following issue

Invariant Violation: "BluedotRewards" has not been registered

If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install and yarn test.

Change the files as per diff provided by react-native-upgrade-helper

rm -rf node_modules
rm package-lock.json
npm cache clean --force
npm install
cd android && ./gradlew clean
react-native run-android -- --reset-cache

What is the expected behavior?

App should run successfully

Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.

Node -18.0.2
OS - Mac OS M2
using npm

Error screenshot

Screenshot 2024-08-21 at 1 20 21 PM

Metro.config.js

const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');

/**
 * Metro configuration
 * https://facebook.github.io/metro/docs/configuration
 *
 * @type {import('metro-config').MetroConfig}
 */
const defaultConfig =  getDefaultConfig(__dirname);

const config = {
  transformer: {
    getTransformOptions: async () => ({
      transform: {
        experimentalImportSupport: false,
        inlineRequires: false,
      },
    }),
    babelTransformerPath: require.resolve('react-native-svg-transformer'),
  },
  resolver: {
    assetExts: defaultConfig.resolver.assetExts.filter(ext => ext !== 'svg'),
    sourceExts: [...defaultConfig.resolver.sourceExts, 'svg'],
  },
};

module.exports = mergeConfig(defaultConfig, config);
{
  "name": "BluedotRewards",
  "version": "2.1.2",
  "private": true,
  "scripts": {
    "android:bundle": "npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle",
    "android:bundle:dev": "npx react-native bundle --platform android --dev true --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle",
    "android:build": "cd android && ./gradlew assembleDebug && cd ..",
    "ios:bundle": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'",
    "ios:bundle:dev": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=true --platform='ios'",
    "android:bundle-release-apk": "npm run android:bundle && npm run android:build && echo 'builds successfully created at android/app/build/outputs/apk/release'",
    "android:clean": "rm -rf node_modules && npm cache clean --force && npm install",
    "android:release": "react-native run-android --variant=release",
    "android": "APP_ENV=development react-native run-android -- --reset-cache",
    "ios": "APP_ENV=development react-native run-ios --simulator='iPhone 14'",
    "ios:iphone8": "APP_ENV=development react-native run-ios --simulator='iPhone 8'",
    "start": "react-native start",
    "clean:android": "echo 'require(\"child_process\").execSync(\"cd android; ./gradlew clean\", {stdio: \"inherit\"})' | node ",
    "clean:ios": "echo 'require(\"child_process\").execSync(\"cd ios; xcodebuild clean\", {stdio: \"inherit\"})' | node ",
    "test": "jest --watchall",
    "test-ci": "jest --passWithNoTests",
    "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
    "lint:fix": "eslint . --fix --ext .js,.jsx,.ts,.tsx",
    "clean": "npm run clean:android && npm run clean:ios",
    "clear-metro-cache": "npm start -- --reset-cache",
    "staging_codepush_android": "appcenter codepush release-react -a Bludot-Technologies-Inc./Open-Rewards-Shop-Local-Android",
    "staging_codepush_ios": "appcenter codepush release-react -a Bludot-Technologies-Inc./rewards-dev",
    "prod_codepush_android": "appcenter codepush promote -a Bludot-Technologies-Inc./Open-Rewards-Shop-Local-Android -s Staging -d Production",
    "prod_codepush_ios": "appcenter codepush promote -a Bludot-Technologies-Inc./rewards-dev -s Staging -d Production",
    "check-dependencies": "rnx-align-deps",
    "fix-dependencies": "rnx-align-deps --write",
    "codepush_android": "npm run staging_codepush_android && npm run prod_codepush_android",
    "codepush_ios": "npm run staging_codepush_ios && npm run prod_codepush_ios",
    "all:bundle": "npm run android:bundle && npm run android:bundle:dev && npm run ios:bundle && npm run ios:bundle:dev"
  },
  "dependencies": {
    "@logrocket/react-native": "^1.27.3",
    "@marqroldan/react-native-geocoder": "^1.1.0",
    "@notifee/react-native": "^7.8.2",
    "@nozbe/watermelondb": "^0.20.0",
    "@nozbe/with-observables": "^1.0.8",
    "@react-native-camera-roll/camera-roll": "https://github.com/react-native-cameraroll/react-native-cameraroll#dd0289f99d10ca45a79982532ea1693e9ca27ee7",
    "@react-native-clipboard/clipboard": "^1.10.0",
    "@react-native-community/cli-platform-android": "^10.0.0",
    "@react-native-community/netinfo": "^9.0.0",
    "@react-native-community/push-notification-ios": "^1.10.0",
    "@react-native-community/slider": "^4.4.2",
    "@react-native-firebase/app": "^18.7.3",
    "@react-native-firebase/messaging": "^18.7.3",
    "@react-native-masked-view/masked-view": "^0.2.8",
    "@react-navigation/material-bottom-tabs": "^5.3.14",
    "@react-navigation/native": "^5.9.3",
    "@react-navigation/routers": "^5.7.2",
    "@react-navigation/stack": "^5.14.3",
    "@sentry/react-native": "^5.22.3",
    "@types/react-redux": "^7.1.16",
    "appcenter": "4.4.5",
    "appcenter-analytics": "4.4.5",
    "appcenter-crashes": "4.4.5",
    "axios": "^0.21.2",
    "base-64": "^1.0.0",
    "dayjs": "^1.10.4",
    "deprecated-react-native-prop-types": "^5.0.0",
    "es6-symbol": "^3.1.3",
    "formik": "^2.2.6",
    "intl": "^1.2.5",
    "jsc-android": "^250231.0.0",
    "jwt-decode": "^3.1.2",
    "libphonenumber-js": "^1.10.48",
    "localized-strings": "^0.2.4",
    "lodash": "^4.17.21",
    "mixpanel-react-native": "^1.3.7",
    "path-to-regexp": "6.2.0",
    "postcode-validator": "^3.8.14",
    "pusher-js": "^8.2.0",
    "react": "18.2.0",
    "react-native": "^0.72.17",
    "react-native-blob-util": "^0.19.11",
    "react-native-code-push": "^7.0.1",
    "react-native-device-info": "^10.11.0",
    "react-native-dotenv": "^2.5.5",
    "react-native-draggable-flatlist": "^4.0.1",
    "react-native-dropdown-picker": "^5.4.6",
    "react-native-encrypted-storage": "^4.0.2",
    "react-native-fast-image": "^8.5.11",
    "react-native-geolocation-service": "^5.3.0-beta.1",
    "react-native-gesture-handler": "^2.12.0",
    "react-native-image-crop-picker": "^0.40.3",
    "react-native-image-zoom-viewer": "^3.0.1",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-localize": "^2.2.1",
    "react-native-maps": "1.7.1",
    "react-native-paper": "^4.12.8",
    "react-native-paper-dates": "^0.4.5",
    "react-native-permissions": "^2.2.2",
    "react-native-pixel-perfect": "^1.0.2",
    "react-native-plaid-link-sdk": "^10.5.0",
    "react-native-qrcode-svg": "^6.2.0",
    "react-native-reanimated": "^3.3.0",
    "react-native-render-html": "^6.3.4",
    "react-native-safe-area-context": "^4.9.0",
    "react-native-screens": "^3.21.0",
    "react-native-skeleton-placeholder": "^5.2.4",
    "react-native-status-bar-height": "^2.6.0",
    "react-native-svg": "^13.14.1",
    "react-native-swiper": "^1.6.0",
    "react-native-vector-icons": "^8.1.0",
    "react-native-walkthrough-tooltip": "^1.6.0",
    "react-native-webview": "^13.2.2",
    "react-redux": "^7.2.2",
    "redux": "^4.0.5",
    "redux-devtools-extension": "^2.13.9",
    "redux-saga": "^1.1.3",
    "rn-sliding-up-panel": "^2.4.6",
    "yup": "^0.32.9"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/plugin-proposal-decorators": "^7.13.5",
    "@babel/runtime": "^7.23.8",
    "@react-native/babel-preset": "^0.73.18",
    "@react-native/eslint-config": "^0.73.2",
    "@react-native/metro-config": "^0.72.0",
    "@react-native/typescript-config": "^0.73.1",
    "@rnx-kit/align-deps": "^2.5.1",
    "@trivago/prettier-plugin-sort-imports": "^2.0.1",
    "@types/jest": "^25.2.3",
    "@types/react": "^18.1.0",
    "@types/react-native": "^0.70.15",
    "@types/react-native-vector-icons": "^6.4.6",
    "@types/react-test-renderer": "^18.0.0",
    "@typescript-eslint/eslint-plugin": "^6.19.0",
    "@typescript-eslint/parser": "^6.19.0",
    "babel-jest": "^29.2.1",
    "babel-plugin-root-import": "^6.6.0",
    "eslint": "^8.56.0",
    "eslint-config-airbnb": "^19.0.4",
    "eslint-config-prettier": "^7.2.0",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-jsx-a11y": "^6.4.1",
    "eslint-plugin-prettier": "^3.3.1",
    "eslint-plugin-react": "^7.22.0",
    "eslint-plugin-react-hooks": "^4.2.0",
    "husky": "^4.2.5",
    "jest": "^29.2.1",
    "jetifier": "^1.6.7",
    "metro-react-native-babel-preset": "^0.76.5",
    "metro-react-native-babel-transformer": "^0.76.9",
    "metro-runtime": "^0.80.10",
    "pod-install": "^0.1.18",
    "prettier": "^2.3.0",
    "pretty-quick": "^3.1.0",
    "react-native-svg-transformer": "^0.14.3",
    "react-test-renderer": "18.2.0",
    "typescript": "4.8.4"
  },
  "eslintConfig": {
    "extends": "@react-native"
  },
  "husky": {
    "hooks": {
      "pre-commit": "pretty-quick --staged"
    }
  },
  "resolutions": {
    "@types/react": "^18.0.24",
    "react-native-windows": "0.72.0"
  },
  "jest": {
    "preset": "react-native",
    "moduleFileExtensions": [
      "ts",
      "tsx",
      "js",
      "jsx",
      "json",
      "node"
    ]
  },
  "rnx-kit": {
    "kitType": "app",
    "alignDeps": {
      "requirements": [
        "[email protected]"
      ],
      "capabilities": [
        "animation",
        "babel-preset-react-native",
        "clipboard",
        "core",
        "core-android",
        "core-ios",
        "gestures",
        "html",
        "jest",
        "navigation/native",
        "navigation/stack",
        "netinfo",
        "react",
        "react-test-renderer",
        "safe-area",
        "screens",
        "svg",
        "webview"
      ]
    }
  }
}

@profaddy profaddy changed the title Invariant Violation: "BluedotRewards" has not been registered Invariant Violation: [App Name] has not been registered Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant