In my case, I was having two different versions of the below implementation in two different modules, So i changed both implementation to versions ie : 6.0.2 and it worked. You may also need to write dependency resolution see the accepted answer.
app module
implementation 'com.karumi:dexter:5.0.0'
commons module
implementation 'com.karumi:dexter:6.0.2'