Which versions are you using:
To help us, please fork this component, modify one example in examples folder to reproduce your issue and include link here.
-
1.
2.
3.
if you are using latest react native version view pager is deprecated, you have to install it from @react-native-community/react-native-viewpager.
otherwise install npm i react-native-swiper@next , this is based on ScrollView, so you can able to resolve view pager error, but this is still not a stable version. there may be some bugs.
A quick workaround is that
Install and auto link npm i @react-native-community/viewpager
then run react-native run-android
Go to node_modules\react-native-swiper\src\index.js and
remove ViewPagerAndroid import from 'react-native' and add this import ViewPager from "@react-native-community/viewpager";
and then at line 652 of index.js replace <ViewPagerAndroid /> with <ViewPager/>
It works for me
Can confirm that the above fix works. This should be branched and then pull requested.
Hi there, I have updated to ^1.6.0-rc.3 but I am still getting the error on ViewPagerAndroid !!
UPDATE
removing and re-installing node_modules did the trick
Node_modules removing and re-installing was not enough for me:
https://github.com/leecade/react-native-swiper/issues/1108#issuecomment-555037592
@henkkasoft Maybe you forgot, the closing ViewPagerAndroid tag after updating the ViewPagerAndroid tag to just ViewPager.
Most helpful comment
A quick workaround is that
Install and auto link npm i @react-native-community/viewpager
then
run react-native run-androidGo to node_modules\react-native-swiper\src\index.js and
remove ViewPagerAndroid import from 'react-native' and add this
import ViewPager from "@react-native-community/viewpager";and then at line 652 of index.js replace
<ViewPagerAndroid />with<ViewPager/>It works for me