If you use Google Maps + Google Play Services in a library project (especially if you recently migrated from Eclipse to Android Studio), you may encounter this error when trying to launch an application using your library, while another application using one and The same library is already installed on your device.
Fix: make sure defaultConfig.applicationId is defined in the Android section of the build.gradle file for each project using your library
android { defaultConfig.applicationId = "com.company.appname" }
I would recommend using the package name for a specific application. With this fix, the vendor names will no longer conflict, and your application will work as expected.
Symptoms
1.) Your users see a terrible installation error "-505" when installing your application from the Play Store.
2.) You will see this error message when you try to install a second application that uses your library through Android Studio [INSTALL_FAILED_CONFLICTING_PROVIDER]:

In your console, you will see the following message:
Package couldn't be installed in /data/app/com.company.appname-1 com.android.server.pm.PackageManagerException: Can't install because provider name com.google.android.gms.measurement.google_measurement_service (in package com.company.appname) is already used by com.company.otherInstalledAppName
Fix this to make sure defaultConfig.applicationId is defined in the Android section of the build.gradle file for each project using your library
android { defaultConfig.applicationId = "com.company.appname" }
Further reading can be found here in the original error report: Issue 784: multiple applications using the same credential provider name
DiscDev Jan 18 '16 at 22:19 2016-01-18 22:19
source share