react-navigation / react-navigation

Routing and navigation for your React Native apps
https://reactnavigation.org
23.5k stars 5.02k forks source link

Invariant Violation: requireNativeComponent: "LEGACY_RNCViewPager" was not found in the UIManager. #11999

Open JmarshTri opened 4 months ago

JmarshTri commented 4 months ago

Current behavior

I've tried anything from RN 73, Reanimated 2 and 3

import * as React from 'react' import { View, useWindowDimensions } from 'react-native' import { TabView, SceneMap } from 'react-native-tab-view'

const FirstRoute = () => ( <View style={{ flex: 1, backgroundColor: '#ff4081' }} /> )

const SecondRoute = () => ( <View style={{ flex: 1, backgroundColor: '#673ab7' }} /> )

const renderScene = SceneMap({ first: FirstRoute, second: SecondRoute, })

export default function TabViewExample() { const layout = useWindowDimensions()

const [index, setIndex] = React.useState(0) const [routes] = React.useState([ { key: 'first', title: 'First' }, { key: 'second', title: 'Second' }, ])

return ( <TabView navigationState={{ index, routes }} renderScene={renderScene} onIndexChange={setIndex} initialLayout={{ width: layout.width }} /> ) }

Expected behavior

Render the tab view without crashing

Reproduction

Can't produce

Platform

Packages

Environment

package version

"@react-navigation/bottom-tabs": "^6.5.20", "@react-navigation/native": "^6.1.17", "@react-navigation/stack": "^6.3.29", "react-native-safe-area-context": "4.10.1", "react-native-screens": "^3.31.1", "react-native-gesture-handler": "^2.14.0", "react-native-reanimated": "^3.11.0", "react-native-tab-view": "3.5.2", "react-native-pager-view": "^6.3.1", "react-native": "0.74.1", "yarn": "^1.22.4"

github-actions[bot] commented 4 months ago

Hey @JmarshTri! Thanks for opening the issue. It seems that the issue doesn't contain a link to a repro.

The best way to get attention to your issue is to provide an easy way for a developer to reproduce the issue.

You can provide a repro using any of the following:

arslan-Techno commented 4 months ago

@JmarshTri did you find any solution ??

kaaaaaaaaaaai commented 4 months ago

same problems

arslan-Techno commented 4 months ago

npm i react-native-pager-view and cd ios && pod install worked for me

rodrigoAbril commented 4 months ago

installing it thru expo fixed it for me npx expo install react-native-pager-view

JmarshTri commented 4 months ago

I added react-native-pager-view via yarn and that does not work. I've also ran "rm -rf node_modules; rm -rf ios/build; rm -rf ios/Pods; rm -rf ios/Podfile.lock; yarn; yarn pods" after installing pager-view still getting the error.

I also tried npx expo install react-native-pager-view no success with that either

kaaaaaaaaaaai commented 4 months ago

i tried, me too

SwanHub commented 4 months ago

installing it thru expo fixed it for me npx expo install react-native-pager-view

worked for me

jilvanx commented 4 months ago

If you are using expo run: npx expo run:ios or npx expo run:android, after installing npx expo install react-native-pager-view Worked for me

JmarshTri commented 4 months ago

I'm not using expo and have yet to find a solution that works

dowatugkins commented 3 months ago

@JmarshTri, did you ever get it figured out? I was having problems after installing it and running pod install so I ran all my blowout everything and rebuild commands and it did the trick for me. I ran my first aliased command rm -rf node_modules/; rm package-lock.json; rm yarn.lock; cd ios; rm -rf Pods/; rm Podfile.lock; rm -rf build/; cd ..; yarn install; cd ios; bundle exec pod repo update; bundle exec pod install; cd .. and then my second aliased command bundle install; cd ios; bundle exec pod repo update; bundle exec pod install; cd .. followed by my reset cache command yarn start --reset-cache followed by my simulator run command yarn ios --simulator 'iPhone 15 Pro Max (iOS 17.4)' and it finally worked. Hopefully you've gotten it figured out by now though.

I also put in a PR to add the need for pod install to the docs when using react-native-tab-view without being tied to react navigation.

viquanghoa commented 3 months ago

after installing npx expo install react-native-pager-view worked for me. Remember that stop simulator then restart, it will work.

franfernandez20 commented 2 months ago

npx expo install react-native-pager-view

That fix the problem for me 👌

pratiksham28 commented 2 months ago

Not working for React-native cli on ios device- "react": "18.2.0", "react-native": "0.74.2", "react-native-pager-view": "^6.3.3", "react-native-tab-view": "^3.5.2", "@react-navigation/bottom-tabs": "^6.5.20", "@react-navigation/material-top-tabs": "^6.6.14", "@react-navigation/native": "^6.1.17", "@react-navigation/native-stack": "^6.9.26", "@react-navigation/stack": "^6.4.0",

bachvinh commented 1 month ago

installing it thru expo fixed it for me npx expo install react-native-pager-view

Worked for me

RutvinBhanderi commented 1 month ago

Not working for React-native cli on ios device- "react": "18.2.0", "react-native": "0.74.2", "react-native-pager-view": "^6.3.3", "react-native-tab-view": "^3.5.2", "@react-navigation/bottom-tabs": "^6.5.20", "@react-navigation/material-top-tabs": "^6.6.14", "@react-navigation/native": "^6.1.17", "@react-navigation/native-stack": "^6.9.26", "@react-navigation/stack": "^6.4.0",

install @6.3.1 version and run this cd ios, pod install

parampreetsingh217 commented 2 weeks ago

installing it thru expo fixed it for me npx expo install react-native-pager-view

worked for me as well maybe try deleting the prev pack and installing this one if it doesnt work the first time.

arielcorte commented 1 week ago

installing it thru expo fixed it for me npx expo install react-native-pager-view

Worked for me! Thanks!

shuvajitmaitra commented 2 days ago

installing it thru expo fixed it for me npx expo install react-native-pager-view

At first, I installed the package and removed the node_modules and installed it again and it worked for me.

Thanks