This error means that there is a duplicated library used on one or many libraries.
To fix it, we should exclude them from our dependencies. On the build.gradle add the following line
dependencies {...}
configurations {
all*.exclude group: 'x', module: 'library'
}