Search code examples
androidxandroid-viewpager2

Android - Program type already present com.transition.R while importing ViewPager2 library


Gradle is throwing Program type already present: androidx.transition.R" after importing androidx.viewpager2:viewpager2:1.0.0-beta02

implementation 'androidx.viewpager2:viewpager2:1.0.0-beta02'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.0.1'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

AGPBI: {"kind":"error","text":"Program type already present: androidx.transition.R","sources":[{}],"tool":"D8"}

Expected outcome: Gradle should compile with no error


Solution

  • I was facing similar problem, Rebuilding the project resolved it.

    Android Studio Menu -> Build -> Rebuild Project.