The solution to avoid this error is, add the property “multiDexEnabled true” under defaultConfig in app’s build.graddle file. It will look like below.
The above solution works for the issue but the root cause is because of multiple libraries added in the app may have same references inside. Try to identify what library exactly needed for the app and remove the extras. If still the issue occurs, above is the solution for it.