Reputation: 153
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
Upvotes: 8
Views: 3821
Reputation: 4864
This is possibly due to build issue.
Either
./gradlew clean
inside the android directory, orandroid/app/build
folderThrough IDE: Android Studio Menu -> Build -> Rebuild Project.
Upvotes: 0
Reputation: 978
actually in my case run ./gradlew clean
inside android directory worked.
I hope it helps you.
Upvotes: 3
Reputation: 2781
First, try:
Build -> Clean Project.
It's faster than Rebuild and except once, always fixed my problems. If it doesn't work, try to rebuild it as @Rahul mentioned.
Upvotes: 2
Reputation: 617
I was facing similar problem, Rebuilding the project resolved it.
Android Studio Menu -> Build -> Rebuild Project.
Upvotes: 23