Invariant Violation: Tried to register two views with the same name RNSVGSvgView - react-native

I added this lib:
https://github.com/mdjfs/expo-image-multiple-picker
then I get this err:
Invariant Violation: Tried to register two views with the same name RNSVGSvgView
ERROR Invariant Violation: "main" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.
package.json
"dependencies": {
"#babel/preset-typescript": "^7.17.12",
"#gorhom/bottom-sheet": "^4.4.0",
"#ramotion/react-native-circle-menu": "^1.0.0",
"#react-native-community/datetimepicker": "6.2.0",
"#react-navigation/bottom-tabs": "6.3.3",
"#react-navigation/native": "6.0.12",
"#react-navigation/native-stack": "6.8.0",
"#reduxjs/toolkit": "^1.8.0",
"#shopify/flash-list": "1.1.0",
"#testing-library/react-native": "^9.0.0",
"#types/jest": "^27.4.1",
"#types/react-native-countdown-component": "^2.7.0",
"axios": "^0.26.1",
"d3-shape": "^3.1.0",
"date-fns": "^2.28.0",
"expo": "^46.0.0",
"expo-app-loading": "~2.1.0",
"expo-constants": "~13.2.3",
"expo-facebook": "~12.2.0",
"expo-font": "~10.2.0",
"expo-haptics": "~11.3.0",
"expo-image-multiple-picker": "^4.5.0",
"expo-image-picker": "~13.3.1",
"expo-linear-gradient": "~11.4.0",
"expo-linking": "~3.2.2",
"expo-media-library": "~14.2.0",
"expo-screen-capture": "~4.3.0",
"expo-screen-orientation": "~4.3.0",
"expo-secure-store": "~11.3.0",
"expo-sharing": "~10.3.0",
"expo-status-bar": "~1.4.0",
"formik": "^2.2.9",
"i18next": "^21.6.14",
"i18next-browser-languagedetector": "^6.1.3",
"i18next-http-backend": "^1.4.0",
"intl": "^1.2.5",
"jest": "^26.6.3",
"jest-expo": "^46.0.0",
"lodash": "^4.17.21",
"lottie-react-native": "5.1.3",
"prop-types": "^15.8.1",
"re-reselect": "^4.0.0",
"react": "18.0.0",
"react-dom": "18.0.0",
"react-fast-compare": "^3.2.0",
"react-freeze": "^1.0.0",
"react-hook-form": "^7.31.3",
"react-i18next": "^11.16.1",
"react-native": "0.69.6",
"react-native-big-list": "^1.5.4",
"react-native-chart-kit": "^6.12.0",
"react-native-collapsible-tab-view": "^5.0.0-rc.6",
"react-native-confirmation-code-field": "^7.3.0",
"react-native-countdown-component": "^2.7.1",
"react-native-gesture-handler": "~2.5.0",
"react-native-image-viewing": "^0.2.2",
"react-native-interactions": "^0.4.0",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-modalize": "^2.0.13",
"react-native-pager-view": "5.4.24",
"react-native-portalize": "^1.0.7",
"react-native-reanimated": "~2.9.1",
"react-native-reanimated-carousel": "3.1.0",
"react-native-redash": "^16.2.3",
"react-native-safe-area-context": "4.3.1",
"react-native-screens": "~3.15.0",
"react-native-select-dropdown": "^2.0.0",
"react-native-skeleton-content": "^1.0.28",
"react-native-slider": "^0.11.0",
"react-native-svg": "12.3.0",
"react-native-tab-view": "^3.1.1",
"react-native-toast-message": "^2.1.5",
"react-native-uuid": "^2.0.1",
"react-native-web": "~0.18.7",
"react-redux": "^7.2.6",
"react-verification-input": "^2.0.6",
"reanimated-bottom-sheet": "^1.0.0-alpha.22",
"recyclerlistview": "^3.0.5",
"reselect": "^4.1.5",
"tinycolor2": "^1.4.2",
"yup": "^0.32.11"
},
"devDependencies": {
"#babel/core": "^7.18.6",
"#types/react": "~18.0.0",
"#types/react-native": "~0.69.1",
"#types/react-redux": "^7.1.23",
"#types/tinycolor2": "^1.4.3",
"babel-eslint": "^10.1.0",
"babel-plugin-module-resolver": "^4.1.0",
"deprecated-react-native-prop-types": "^2.3.0",
"eslint": "^8.12.0",
"react-native-dotenv": "^3.3.1",
"typescript": "^4.6.3"
},
"private": true
so what can I do to prevent this error message ? thank you for your answers
................................................................................................................................................................................................................

This usually resolves by stopping the Metro bundler, deleting your /node_modules and /ios/Pods folders, running yarn install && npx pod-install, restarting the bundler -- yarn start, and rebuilding your application.
N.B. Replace yarn with npm if you are using npm for package management.

Related

Expo (react-native) Failed to load all assets on production env (expo start --no-dev -c)

Getting Failed to load all assets error on production environment while running with expo start --no-dev -c command. The error happens on both iOS & Android. Tried clearing npm cache, metro bundler cache. Still no luck. Could not find a valid solution from the forums or expo discord community. Any ideas/help are most welcome.
package.json as follows
"dependencies": {
"#react-native-async-storage/async-storage": "~1.17.3",
"#react-native-community/datetimepicker": "6.1.2",
"#react-native-community/netinfo": "8.2.0",
"#react-native-masked-view/masked-view": "0.2.6",
"#react-navigation/bottom-tabs": "^5.11.15",
"#react-navigation/drawer": "^5.12.9",
"#react-navigation/native": "^5.9.8",
"#react-navigation/stack": "^5.14.9",
"#reduxjs/toolkit": "^1.7.2",
"date-fns": "^2.23.0",
"expo": "^45.0.0",
"expo-camera": "~12.2.0",
"expo-dev-client": "~1.0.1",
"expo-device": "~4.2.0",
"expo-document-picker": "~10.2.1",
"expo-file-system": "~14.0.0",
"expo-font": "~10.1.0",
"expo-image-picker": "~13.1.1",
"expo-location": "~14.2.2",
"expo-notifications": "~0.15.4",
"expo-splash-screen": "~0.15.1",
"expo-status-bar": "~1.3.0",
"expo-updates": "~0.13.3",
"formik": "^2.2.9",
"just-clone": "^3.2.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-native": "0.68.2",
"react-native-calendars": "^1.1266.0",
"react-native-gesture-handler": "~2.2.1",
"react-native-keyboard-aware-scroll-view": "^0.9.4",
"react-native-pager-view": "5.4.15",
"react-native-popup-menu": "^0.15.11",
"react-native-reanimated": "~2.8.0",
"react-native-root-toast": "^3.4.0",
"react-native-safe-area-context": "4.2.4",
"react-native-screens": "~3.11.1",
"react-native-svg": "12.3.0",
"react-native-tab-view": "^2.16.0",
"react-native-timeline-feed": "^2.0.0",
"react-native-web": "0.17.7",
"react-native-webview": "11.18.1",
"react-redux": "^7.2.6",
"uuid": "^8.3.2",
"victory-native": "^35.5.4",
"yup": "^0.32.9"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"babel-jest": "^25.2.6",
"eslint": "^7.32.0",
"eslint-plugin-react": "^7.25.1",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-react-native": "^3.11.0",
"jest": "^26.6.3",
"react-test-renderer": "17.0.1",
"reactotron-react-native": "^5.0.0",
"reactotron-redux": "^3.1.3"
}
For me, I accidentally left 1 character out of Text element.
It started to work after I remove the character.
Try examining your recent code.

Getting error of "Tried to register two views with the same name RNCViewpager

Hi, I am getting the error, but i don't know how to solve it.
I think it caused by the conflicts between react-native-tab-view and react-native-pager-view
I tried
remove node_modules and re-install.
installed different versions of react-native-pager-view
added "resolutions" in package.json.
My package.json is
"dependencies": {
"#invertase/react-native-apple-authentication": "^2.1.2",
"#react-native-community/blur": "^3.6.0",
"#react-native-community/geolocation": "^2.0.2",
"#react-native-community/masked-view": "^0.1.10",
"#react-native-community/toolbar-android": "0.1.0-rc.2",
"#react-native-firebase/analytics": "^11.3.2",
"#react-native-firebase/app": "^11.3.2",
"#react-native-google-signin/google-signin": "^6.0.0",
"#react-navigation/bottom-tabs": "^5.11.8",
"#react-navigation/native": "^5.9.3",
"#react-navigation/stack": "^5.14.3",
"dateformat": "^3.0.3",
"filter-obj": "^2.0.2",
"lodash": "^4.17.15",
"lottie-ios": "^3.1.8",
"lottie-react-native": "^3.5.0",
"moment": "^2.29.1",
"patch-package": "^6.2.2",
"payment": "^2.3.0",
"react": "17.0.1",
"react-content-loader": "^6.0.3",
"react-native": "0.64.1",
"react-native-background-upload": "^5.6.1",
"react-native-base64": "0.0.2",
"react-native-bootsplash": "^2.2.4",
"react-native-check-box": "^2.1.7",
"react-native-checkbox-form": "^1.1.5",
"react-native-checkbox-group": "^1.0.3",
"react-native-credit-card-input-fullpage": "^0.2.0",
"react-native-device-info": "^8.0.5",
"react-native-dialog": "^5.6.0",
"react-native-drawer-layout-polyfill": "^2.0.0",
"react-native-fbsdk": "^1.1.2",
"react-native-gesture-handler": "^1.10.3",
"react-native-google-places-autocomplete": "^1.8.0",
"react-native-image-picker": "^2.3.3",
"react-native-key-value-storage": "^3.1.0",
"react-native-keyboard-accessory": "^0.1.12",
"react-native-loading-spinner-overlay": "^1.1.0",
"react-native-material-buttons": "^0.6.0",
"react-native-material-textfield": "^0.16.1",
"react-native-no-flicker-image": "^1.0.2",
"react-native-pager-view": "^5.1.3",
"react-native-paper": "^4.7.2",
"react-native-phone-input": "^0.2.4",
"react-native-picker-select": "^8.0.4",
"react-native-ratings": "^7.4.0",
"react-native-reanimated": "^1.10.1",
"react-native-responsive-screen": "^1.4.1",
"react-native-safe-area-context": "^0.7.3",
"react-native-screens": "^2.10.1",
"react-native-scrollable-tab-view": "^1.0.0",
"react-native-section-list-get-item-layout": "^2.2.3",
"react-native-secure-storage": "^0.1.2",
"react-native-simple-radio-button": "^2.7.4",
"react-native-star-rating": "^1.1.0",
"react-native-super-grid": "^3.2.0",
"react-native-svg": "^12.1.1",
"react-native-swipe-gestures": "^1.0.5",
"react-native-tab-view": "^3.0.1",
"react-native-vector-icons": "^7.0.0",
"react-native-version-check": "^3.4.2",
"react-native-webview": "^10.3.3",
"react-native-windows": "^0.62.4",
"react-navigation": "^4.4.0",
"react-navigation-drawer": "^2.5.0",
"react-navigation-material-bottom-tabs": "^2.3.0",
"react-navigation-stack": "^2.8.2",
"string": "^3.3.3",
"tipsi-stripe": "^7.5.3",
"typescript": "^3.9.7" },
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.12.5",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "^7.14.0",
"jest": "^26.6.3",
"jetifier": "^1.6.6",
"metro-react-native-babel-preset": "^0.64.0",
"react-native-dotenv": "0.2.0",
"react-test-renderer": "17.0.1" },
"jest": {
"preset": "react-native" }
}
I clone the repo and modified the ViewManger Name and it worked fine for me you may try it.
past following, to roo dir in package.json and run command yarn install
"react-native-pager-view": "git://github.com/AtaMuhiuldin/react-native-view-pager.git"
it's working for me!
Here there is small issue in lib i guess.
If you import like below
import PagerView from 'react-native-pager-view';
It will not work, but if you try to import like below, it will work.
import { PagerView } from 'react-native-pager-view';
npm uninstall react-native-pager-view
then
npx react-naive run-android
i notice that the problem is that when you install the library and this library exist already on some other libraries dependencies
you can import it without install it again
check package-lock.json you can find it already

Invariant Violation: ViewPagerAndroid has been removed from React Native. Expo v35 to v39 Migration

Tried most of the solutions and even updated all the packages but none of them is working for me.
Touching this project after a while so was migrating from
React Native Expo v35 to v39.
Error Stack Trace:
My list of packages:
package.json
"dependencies": {
"#apollo/react-components": "^3.0.1",
"#apollo/react-hoc": "^3.1.1",
"#apollo/react-hooks": "^3.0.0",
"#react-native-community/async-storage": "~1.12.0",
"#react-native-community/viewpager": "^4.1.6",
"apollo-boost": "^0.4.4",
"apollo-fetch": "^0.7.0",
"apollo-link": "^1.2.13",
"apollo-link-context": "^1.0.19",
"crypto": "^1.0.1",
"crypto-js": "^4.0.0",
"expo": "^39.0.3",
"expo-facebook": "~9.0.0",
"expo-font": "~8.3.0",
"expo-google-app-auth": "^8.0.0",
"expo-image-picker": "~9.1.0",
"expo-notifications": "~0.7.2",
"graphql": "^14.4.2",
"moment": "^2.24.0",
"native-base": "^2.13.8",
"react": "16.13.1",
"react-apollo": "^3.1.3",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-39.0.0.tar.gz",
"react-native-aws3": "^0.0.9",
"react-native-gesture-handler": "~1.7.0",
"react-native-google-places-autocomplete": "^1.4.1",
"react-native-material-ripple": "^0.9.1",
"react-native-modal": "^11.5.6",
"react-native-modal-datetime-picker": "^7.6.0",
"react-native-multiple-select": "^0.5.3",
"react-native-paper": "^3.0.0",
"react-native-picker-select": "^6.3.3",
"react-native-screens": "~2.10.1",
"react-native-status-bar-height": "^2.4.0",
"react-native-vector-icons": "^6.6.0",
"react-native-web": "~0.13.7",
"react-navigation": "^4.4.2",
"react-navigation-drawer": "^1.4.0",
"react-navigation-stack": "^1.7.3",
"react-navigation-tabs": "^1.2.0",
"react-redux": "^7.1.1",
"redux": "^4.0.4",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"#graphql-codegen/introspection": "^1.12.2",
"#types/react": "~16.9.35",
"#types/react-native": "~0.63.2",
"babel-jest": "^24.9.0",
"babel-preset-expo": "^8.3.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
"jest": "^24.9.0",
"jest-environment-enzyme": "^7.1.1",
"jest-enzyme": "^7.1.1",
"react-test-renderer": "16.8.3",
"typescript": "~3.9.2"
},
"private": true
}
Based on what I read, it's some package that is causing this issue.
Can someone please help me find the package based on the Trace Stack?
I was unable to find it.
Package Name: react-navigation.
How to search:
Search for ViewPagerAndroid in your VS Code and don't exclude node_modules.
What you need to replace?
import {ViewPagerAndroid} from 'react-native'
with
import ViewPagerAndroid from '#react-native-community/viewpager'
NOTE:
You will need to add #react-native-community/viewpager package

Unable to build react-native android app after updating to AndroidX and react-native version 0.59.10

I am getting the below error after updating my react-native version to 0.59.10 on android.
(0,react.memo) is not a function.(in '(0,_react.memo)(FastimageBase)')'),'(0,_react.memo)' is undefined)
My Package.json file is as follows:
"dependencies": {
"#ptomasroos/react-native-multi-slider": "^1.0.0",
"#pusher/chatkit-client": "^1.4.1",
"axios": "^0.18.0",
"base-64": "^0.1.0",
"esdoc": "^1.1.0",
"esdoc-standard-plugin": "^1.0.0",
"moment": "^2.22.2",
"native-base": "^2.13.4",
"npm": "^6.1.0",
"password-validator": "^4.1.1",
"react": "^16.6.0",
"react-native": "0.59.10",
"react-native-actionsheet": "^2.4.2",
"react-native-animatable": "^1.3.0",
"react-native-aws3": "0.0.8",
"react-native-base64": "0.0.2",
"react-native-circular-progress": "^1.1.0",
"react-native-confirmation-code-field": "^3.1.2",
"react-native-document-picker": "^2.2.0",
"react-native-dynamic-cropper": "^0.1.0",
"react-native-easy-toast": "^1.2.0",
"react-native-email": "^1.0.2",
"react-native-fast-image": "^6.1.1",
"react-native-firebase": "^5.4.2",
"react-native-floating-action": "^1.13.0",
"react-native-fs": "^2.13.3",
"react-native-gifted-chat": "^0.7.3",
"react-native-image-crop-picker": "^0.24.1",
"react-native-image-pan-zoom": "^2.1.11",
"react-native-image-progress": "^1.1.1",
"react-native-imagepicker": "^2.0.0",
"react-native-localization": "^2.0.1",
"react-native-material-textfield": "^0.12.0",
"react-native-mixpanel": "^1.1.1",
"react-native-modal": "^7.0.2",
"react-native-modal-datetime-picker": "^6.1.0",
"react-native-open-settings": "^1.0.1",
"react-native-pdf": "^5.1.3",
"react-native-permissions": "^1.1.1",
"react-native-phone-call": "^1.0.9",
"react-native-popup-dialog": "^0.18.2",
"react-native-progress": "^3.5.0",
"react-native-shadow": "^1.2.2",
"react-native-share": "^1.2.1",
"react-native-simple-radio-button": "^2.7.3",
"react-native-svg": "^8.0.11",
"react-native-uuid-generator": "^5.0.0",
"react-native-version-number": "^0.3.5",
"react-navigation": "^2.17.0",
"react-redux": "^5.1.1",
"redux": "^4.0.4",
"redux-thunk": "^2.3.0",
"rn-fetch-blob": "^0.10.15",
"rn-sliding-up-panel": "^1.3.1",
"rollbar-react-native": "^0.5.0"
}
Please change version by running following command:
`npm install react-redux#6.0.1 --save`
Make sure you have react version 16.8.3 and then reset cache before running app with
npm start -- --reset-cache

React Native: No dimension set for key window in production

I'm getting this error
RCTFatalException: Unhandled JS Exception: No dimension set for key windowmh_execute_header
Unhandled JS Exception: No dimension set for key window, stack: value#75:505
in production. I believe that it's an issue with RN: https://github.com/facebook/react-native/issues/13758
All of the solutions in that thread look like they are for the development environment. Is there a way to fix this for production (after uploading a new build of course)?
"dependencies": {
"#yfuks/react-native-action-sheet": "latest",
"bugsnag-react-native": "^2.2.3",
"iap-receipt-validator": "^1.0.6",
"js-uuid": "^0.0.6",
"lodash": "^4.17.4",
"moment": "^2.17.1",
"phoenix": "^1.2.1",
"react": "16.0.0-alpha.6",
"react-native": "0.44.0",
"react-native-animatable": "^1.1.0",
"react-native-aws3": "^0.0.8",
"react-native-code-push": "^2.0.3-beta",
"react-native-collapsible": "^0.8.0",
"react-native-elevated-view": "^0.0.3",
"react-native-firestack": "^2.3.9",
"react-native-flags": "^1.0.0",
"react-native-geocoder": "^0.4.8",
"react-native-image-picker": "^0.26.1",
"react-native-image-resizer": "^0.1.0",
"react-native-in-app-utils": "^5.2.3",
"react-native-incall-manager": "^2.1.0",
"react-native-keep-awake": "^2.0.4",
"react-native-loading-spinner-overlay": "latest",
"react-native-localization": "^0.1.30",
"react-native-modalbox": "^1.3.9",
"react-native-permissions": "^0.2.7",
"react-native-progress": "^3.2.1",
"react-native-push-notification": "^2.2.1",
"react-native-sound": "^0.10.0",
"react-native-spinkit": "^1.0.2",
"react-native-swiper": "^1.5.4",
"react-native-vector-icons": "^4.0.0",
"react-native-webrtc": "^1.57.0",
"react-native-zzy-toast": "^0.1.3",
"react-redux": "^5.0.3",
"redux": "^3.6.0",
"redux-logger": "^2.8.2",
"redux-observable": "^0.14.1",
"redux-persist": "^4.5.0",
"rn-splash-screen": "^4.0.0",
"rxjs": "^5.2.0"
},
If have you installed react-native-router-flux 3.38.0 after removing "^" from dependencies?