React Native & Expo errors · Error 05 of 12
Android “Duplicate class … found in modules”
By Muhammad Abdullah, full-stack, mobile and ai automation developer · Last reviewed
Execution failed for task ':app:checkReleaseDuplicateClasses'. Duplicate class … found in modules …Short answer
Two dependencies include the same Java/Kotlin classes. Find which libraries the error names, then update, remove or exclude one of them so only one copy is bundled.
Common causes
- Two versions of the same library pulled in by different packages.
- An old library still using pre-AndroidX support libraries alongside AndroidX.
- A library and its “-ktx” or “-jdk” variant both being included.
How to fix it
Read the two module names in the error message; they tell you which dependencies clash.
Update the React Native libraries that bring them in to versions compatible with your SDK:
npx expo install --fixIf the conflict remains, remove the outdated library or exclude the duplicate module in Gradle (in Expo, via a config plugin) and rebuild.