callstack / react-native-pager-view

React Native wrapper for the Android ViewPager and iOS UIPageViewController.
MIT License
2.66k stars 410 forks source link

[Android] Could not find viewpager2-1.0.0.jar (androidx.viewpager2:viewpager2:1.0.0) #357

Closed iamhaaamed closed 3 years ago

iamhaaamed commented 3 years ago

Environment

"react-native": "0.64.1" "@react-native-community/viewpager": "^5.0.11"

Devices: HTC Nexus One (Android 11)

Description

project does not working on android

Stack trace

Could not resolve all files for configuration ':react-native-community_viewpager:debugCompileClasspath'.

Could not find viewpager2-1.0.0.jar (androidx.viewpager2:viewpager2:1.0.0). Searched in the following locations: https://dl.google.com/dl/android/maven2/androidx/viewpager2/viewpager2/1.0.0/viewpager2-1.0.0.jar

reza-madani commented 3 years ago

Change viewpager version in : node_modules/react-native-pager-view/android/build.gralde: implementation 'androidx.viewpager2:viewpager2:1.1.0-alpha01'

iamhaaamed commented 3 years ago

Change viewpager version in : node_modules/react-native-pager-view/android/build.gralde: implementation 'androidx.viewpager2:viewpager2:1.1.0-alpha01'

in this way i should always do the change after npm install or yarn

ynonra commented 3 years ago

Change viewpager version in : node_modules/react-native-pager-view/android/build.gralde: implementation 'androidx.viewpager2:viewpager2:1.1.0-alpha01'

Didn't work for me... :(

BUT I ran it on android studio, and it worked without errors, and then when I ran it on react native it worked too!

maleking commented 2 years ago

Change viewpager version in : node_modules/react-native-pager-view/android/build.gralde: implementation 'androidx.viewpager2:viewpager2:1.1.0-alpha01'

in this way i should always do the change after npm install or yarn

you can use patch package https://www.npmjs.com/package/patch-package