Reputation: 11
I just updated my project' SDK because the expo GO IOS app updated automatically to SDK51. My project works fine with SDK 50. But after updating, I got error: Invariant Violation: "main" has not been registered. This can happen if:
AppRegistry.registerComponent
wasn't called., js engine: hermesHere is my package.json:
{
"name": "client",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"lint": "eslint . --ext .js,.jsx ./",
"lint-fix": "eslint . --ext .js,.jsx ./ --fix"
},
"dependencies": {
"@babel/eslint-parser": "^7.23.10",
"@gorhom/bottom-sheet": "^4.6.1",
"@react-native-community/checkbox": "^0.5.17",
"@react-navigation/bottom-tabs": "^6.5.11",
"@react-navigation/drawer": "^6.6.15",
"@react-navigation/material-top-tabs": "^6.6.5",
"@react-navigation/native": "^6.1.9",
"@react-navigation/native-stack": "^6.9.17",
"@react-navigation/stack": "^6.3.20",
"@reduxjs/toolkit": "^2.2.1",
"antd": "^5.12.2",
"deprecated-react-native-prop-types": "^5.0.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-react": "^7.34.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-native": "^4.1.0",
"expo": "^51.0.0",
"expo-build-properties": "~0.12.1",
"expo-camera": "~15.0.6",
"expo-image-picker": "~15.0.4",
"expo-linear-gradient": "~13.0.2",
"expo-media-library": "~16.0.3",
"expo-status-bar": "~1.12.1",
"firebase": "^10.11.0",
"moment": "^2.29.4",
"moti": "^0.28.1",
"nativewind": "^2.0.11",
"radio-buttons-react-native": "^1.0.4",
"react": "18.2.0",
"react-native": "0.74.1",
"react-native-gesture-handler": "~2.16.1",
"react-native-pager-view": "6.3.0",
"react-native-popover-view": "^5.1.8",
"react-native-popup-menu": "^0.16.1",
"react-native-reanimated": "~3.10.1",
"react-native-reanimated-carousel": "^3.5.1",
"react-native-redash": "^18.1.2",
"react-native-render-html": "^6.3.4",
"react-native-safe-area-context": "4.10.1",
"react-native-screens": "3.31.1",
"react-native-star-rating": "^1.1.0",
"react-native-svg": "15.2.0",
"react-native-swiper": "^1.6.0",
"react-native-switch": "^1.5.1",
"react-native-tab-view": "^3.5.2",
"react-native-vector-icons": "^10.0.3",
"react-redux": "^9.1.0",
"redux": "^5.0.1",
"tailwindcss": "3.3.2"
},
"devDependencies": {
"@babel/core": "^7.24.0",
"@types/react": "~18.2.79",
"@types/react-native": "^0.73.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.2.5",
"typescript": "~5.3.3"
},
"private": true
}
Help me pls. Thanks all.
I tried to update the react native version and some others solutions on stack overflow but it did not work.
Upvotes: 0
Views: 2612
Reputation: 1
My Package.json file is:
{
"name": "nhdp",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web"
},
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.0",
"@expo/metro-runtime": "~3.1.3",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-navigation/native": "^6.1.17",
"@react-navigation/native-stack": "^6.9.26",
"expo": "^51.0.1",
"expo-blur": "~13.0.2",
"expo-build-properties": "~0.12.1",
"expo-constants": "~16.0.1",
"expo-document-picker": "~12.0.1",
"expo-font": "~12.0.4",
"expo-image": "~1.12.9",
"expo-image-picker": "~15.0.5",
"expo-linear-gradient": "~13.0.2",
"expo-linking": "~6.3.1",
"expo-router": "~3.5.14",
"expo-status-bar": "~1.12.1",
"nativewind": "^2.0.11",
"react": "18.2.0",
"react-device-detect": "^2.2.3",
"react-dom": "18.2.0",
"react-native": "0.74.1",
"react-native-device-info": "^10.13.1",
"react-native-document-picker": "^9.1.2",
"react-native-flash-message": "^0.4.2",
"react-native-inset-shadow": "^1.0.3",
"react-native-loading-spinner-overlay": "^3.0.1",
"react-native-modal": "^13.0.1",
"react-native-pdf-viewer": "^0.1.1",
"react-native-reanimated": "~3.10.1",
"react-native-safe-area-context": "4.10.1",
"react-native-screens": "3.31.1",
"react-native-step-indicator": "^1.0.3",
"react-native-uuid": "^2.0.2",
"react-native-walkthrough-tooltip": "^1.6.0",
"react-native-web": "~0.19.6",
"react-native-webview": "13.8.6",
"rn-fetch-blob": "^0.12.0",
"sha3": "^2.1.4",
"universal-tooltip": "^1.1.0",
"expo-web-browser": "~13.0.3"
},
"devDependencies": {
"@babel/core": "^7.20.0"
},
"private": true
}
and I can not navigate between screens. I have imported "react-native-reanimated" to my app.js file but still Expo go crashes when I navigate between screens.
Upvotes: 0
Reputation: 1
I was getting the same error the what I did is that I deleted the node_modules and package_lock.json when and than ran npm install again all the errors were removed but then when i started the app it is not starting instead it shows something went wrong ( Network response timed out ) "
Upvotes: 0
Reputation: 11
got the same issue and this one helped me : https://github.com/expo/expo/issues/28618
Upvotes: 1