Android - Program type already present com.transition.R while importing ViewPager2 library
I was facing similar problem, Rebuilding the project resolved it.
Android Studio Menu -> Build -> Rebuild Project.
actually in my case run ./gradlew clean
inside android directory worked.
I hope it helps you.