React-native-swiper: Not working on react native 0.61.2

Created on 11 Oct 2019  Â·  7Comments  Â·  Source: leecade/react-native-swiper

I try swiper newest version but can not swipe on react native 0.61.2, i copied the example on this git repo but not work.

Missing Example No Template

Most helpful comment

Invariant Violation: ViewPagerAndroid has been removed from React Native. It can now be installed and imported from 'react-native-viewpager' instead of 'react-native'. See https://github.com/react-native-community/react-native-viewpager

A quick workaround is that:https://github.com/leecade/react-native-swiper/issues/1071

Install and auto link npm i @react-native-community/viewpager

then run react-native run-android

Go to node_modulesreact-native-swipersrcindex.js and

remove ViewPagerAndroid import from 'react-native' and add thisimport ViewPager from "@react-native-community/viewpager";

and then at line 652 of index.js replace <ViewPagerAndroid /> with <ViewPager/>

that made it work for me.

All 7 comments

even its not working for me, i have saw some solutions related to view pager but i dont think thats related to this, as we are using scrollview in this, any help will appreciated. @ArrayZoneYour can you please look into it :)

@ursNj But it just work fine under my 0.61.2 project, can you provide an example like #1080 ?

Has there been any headway with this ? I'm having the same challenge. It works fine on ios but does not work on android.

Invariant Violation: ViewPagerAndroid has been removed from React Native. It can now be installed and imported from 'react-native-viewpager' instead of 'react-native'. See https://github.com/react-native-community/react-native-viewpager

A quick workaround is that:https://github.com/leecade/react-native-swiper/issues/1071

Install and auto link npm i @react-native-community/viewpager

then run react-native run-android

Go to node_modulesreact-native-swipersrcindex.js and

remove ViewPagerAndroid import from 'react-native' and add thisimport ViewPager from "@react-native-community/viewpager";

and then at line 652 of index.js replace <ViewPagerAndroid /> with <ViewPager/>

that made it work for me.

Probably a better idea to upgrade to the nightly release @cxfamily . Especially as ViewPager has been replaced in favor of ScrollView.

I just upgraded to it, can confirm that it works on 0.61.2.

@cxfamily I have just installed the nightly release as @AugustGSP said and it resolved the Invariant Violation: ViewPagerAndroid... Issue

remove wrapper width and height
E.g :
wrapper: {
// width: 600,
// height: 450 ,
},

Was this page helpful?
0 / 5 - 0 ratings

Related issues

diegolmello picture diegolmello  Â·  3Comments

ghost picture ghost  Â·  3Comments

kylehagler picture kylehagler  Â·  3Comments

nicolabortignon picture nicolabortignon  Â·  3Comments

chetanparakh picture chetanparakh  Â·  3Comments