Gradle: Error: Program type already present: androidx.activity.R$attr
I had the same problem. Just using the Clean Project option and building it again worked for me...
It took me two days to fix it but here is the fix:
implementation ('com.google.android.ads.consent:consent-library:1.0.0') {
exclude group: 'androidx'
}