Unable to merge dex Ionic 3

What helped me was running:

cordova clean

I did struggle with this issue for 2 days after i used google maps plugin inside my app and i suppose it is because of google-play-service conflicts and i resolved it by install the latest grade release by using this command. Hope it helps anyone else facing this issue

ionic cordova plugin add cordova-android-play-services-gradle-release

I solved this issue by running simply this command and then build the project. don't go into complicated answers like upgrading Gradle or google packages etc..

 cordova clean android 
 ionic cordova build android