We have a React Native app where after upgrading to Android Studio 3.6.1 and Gradle plugin 3.6.1 we are seeing this compilation error:
Type androidx.appcompa
I had same issue after updating gradle version to 3.6.3 from 3.5.2 in Android Studio.
I have multiple Build Variants.
I fixed the issue by first deleting .gradle folder from the project and did Clean Project and Rebuild Project.
If you have multiple build variant you may have to do same thing for each one when you change build variants from one to another.
While I was coding on the android studio on native android.Got the same problem
Type androidx.appcompat.resources.R$dimen is defined multiple times:
The problem is because of the Duplication of the BuildConfig which is present inside the JAVA (Generated) Directory
Here is the solution to fix the problem.
You have to delete the duplicate BuildConfig from the android studio by this process
Problem Solved
Igor Montella's comment to my question fixed the problem - downgrade to gradle plugin 3.5.0.
Got the same problem, just clean project and rebuild again.
File->Invalidate Caches / Restart
My errors were similar, with a "is defined multiple times" message.
I solved it by downgrading the Gradle plugin to 3.5.0, running the app — or at least trying to — then upgrading to Gradle plugin 3.6.2 again.
I am not sure why, but this seemed to have cleared some caches or dependencies I was not aware of.
Removing ~/.gradle
or android/.gradle
did not help.