androidandroid-manifestandroid-authenticator

Cannot update app : INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: Package *** tried to change user ***


I am currently working on an Android application developed with native tools (Anroid Studio, Java, Android SDK, etc.) in order to replace an existing application already available in the Play Store and which was developed with Xamarin.

I am trying to simulate the update of the app by installing the current version from the play store and then install the new version in command line : adb install -r myApp.apk.

Then I am getting this error message :

Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: Package com.myapp.package tried to change user com.domain.param]

According to my researches, the previous app declares a sharedUserId into the manifest and I cannot remove it. So in the manifest of my new app, I add the following information :

android:sharedUserId="com.domain.param"
android:sharedUserLabel="@string/sharedUserLabel"

The values are the same of the old app. But I am still getting the error.

Do I need to add more information in the manifest ? I am using the same keystore signature for both apps.

Edit : I have also declared an AuthenticatorService with the same values :

<service android:name="com.myapp.package.AuthenticatorService">
  <meta-data
    android:name="android.accounts.AccountAuthenticator"
    android:resource="@xml/authenticator"
  />

  <intent-filter>
    <action android:name="android.accounts.AccountAuthenticator" />
  </intent-filter>
</service>

Any idea ?


Solution

  • The android:sharedUserId and the android:sharedUserLabel attributes have to be declared into the <manifest> markup and not into the <application> one...