I am using an open-srouce code from Google for an app called MyTracks.
I am getting this error when the original app is installed on the phone.
INSTALL_FAILED_CONFLICTING_PROVIDER
I know that this is because of the android:authorities
in the Manifest.
here is the part of the Manifest:
<provider
android:name="com.google.android.apps.mytracks.content.MyTracksProvider"
android:authorities="com.google.android.maps.mytracks"
android:exported="true"
android:readPermission="com.google.android.apps.mytracks.READ_TRACK_DATA"
android:writePermission="com.google.android.apps.mytracks.WRITE_TRACK_DATA" />
<!-- Search suggestion provider -->
<provider
android:name="com.google.android.apps.mytracks.content.SearchEngineProvider"
android:authorities="com.google.android.maps.mytracks.search"
android:exported="false" />
So, my question is: I want to know whether this approach may solve the problem or not, because I am afraid of changing all the packages names and then have the whole app broken.
- The
android :authorities
value is the package name. Theandroid:name
is the name of the class of that provider. Am I correct?
If I change the package name, to another one different than the com.google etx, and rename all the references/ imports of that package, should the problem go away?
Just Uninstall the application from the device which you are trying to run and try to reinstall application again. The existing application is conflicting with the new one.
If you are using Google Maps + Google Play Services inside a library project, you can encounter this error when you try to run an app that uses your library, while a different app that uses the same library is already installed on your device.
Fix: make sure that defaultConfig.applicationId is defined in android section of the
build.gradle
file for each project using your libraryI would recommend using the package name of the specific app. With this fix, the provider names will no longer conflict, and your app will run as expected.
Symptoms
1.) Your users are seeing the dreaded "-505" install error when installing your app from the Play Store.
2.) You will see this error message when you try to install a second app that uses your library via Android Studio:
In your console, you will see a message like this:
The fix is to make sure that defaultConfig.applicationId is defined in android section of the
build.gradle
file for each project using your libraryMore reading can be found here in the original bug report: Issue 784: Multiple apps using same authority provider name
You maybe compile same library or including libraries. For example :
Above code, google play services (first line ) includes all other services .
may be your phone memory is full so please check it
CommonsWare has it right, however, there are more details that may help.
For me, there were two key parts of the solution. First I added $(applicationId) to Manifest provider entry:
Second, when you switch Build Varients, and for me this is between 'debug' and 'release', you also need to Sync Project with Gradle Files. It was not enough to just Clean and Rebuild project.
In Android Studio there are two tabs in the bottom of the AndroidManifest.xml page. The 'Text' tab you use to edit and the 'Merged Manifest' tab shows the resulting manifest after the build, and for me I can see it was injecting the applicationId properly into the android:authorities section of the provider.
if you use for ex facebook-sdk then for each app you need unique this line in manifest
xxxxxxxxxx - should be unique for each app, for facebook-sdk it's your facebook_id number