Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Switching to gradle caused INSTALL_FAILED_UPDATE_INCOMPATIBLE, cannot install over previous version

Discussion in 'Android' started by andrew-fray, Jul 3, 2018.

  1. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    155
    Hi folks,

    Unity 2017.4.5, Google Play Games plugin 0.9.50.

    If we install a build of our game with the build system set to internal, then turn on gradle and proguard minimising, let the android dependencies resolve, and make a new build, the new build won't install over the top of the old one:

    Code (csharp):
    1. adb: failed to install ab2-gradle-prefb.apk: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.XXX.XXX signatures do not match the previously installed version; ignoring!]
    There's no other changes between the builds.

    We don't have a central android manifest. I pulled the internal-generated one from Temp/StagingArea, and compared it to the gradle-generated one from Temp/gradleOut/build/intermediates/manifests/full/debug, and there's a few differences but I don't know how important they are (after some massaging):



    The big one seems to be a bunch of missing info from uses-sdk, but it also might be that I'm barking up the wrong tree by looking at the manifests.

    How can we fix it so gradle builds are installable over internal builds? We need a smooth way for our users to upgrade. Is there more information I can give you?
     
    Last edited: Jul 3, 2018
  2. SevenPointRed

    SevenPointRed

    Joined:
    Feb 3, 2016
    Posts:
    218
    I got this as well but never got a fix. I just went back to internal.
    I was always worried that users would have a problem updating the game if i left it with this error
     
  3. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    155
    Interestingly, a non-development build _can_ install on top of our old builds.
     
  4. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    155
    Ah but a development gradle build can't install on top of a non-development gradle build. Which sucks for release testing.
     
  5. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Is you app built with Oculus SDK enabled?
     
  6. SevenPointRed

    SevenPointRed

    Joined:
    Feb 3, 2016
    Posts:
    218
    Mine isn't and I get the same issue.
     
  7. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Can you please post details about your "same issue" - error log and manifest?
     
  8. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    155
    @Yury-Habets no oculus sdk, and everything's unticked in the XR section of the player prefs. what other info can I get you?
     
  9. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    155
    in fact it seems just kind of random if a development build will install or not. right now it just failed to install a development build on top of a cloud development build, both of the same version number and both very close in source control.
     
  10. SevenPointRed

    SevenPointRed

    Joined:
    Feb 3, 2016
    Posts:
    218
    The same issue has the same error:

    "Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.sevenpointred.expanse signatures do not match the previously installed version"

    Code (CSharp):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <manifest android:versionName="1.0" android:versionCode="1" package="com.unity3d.player" xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android">
    3.   <application android:icon="@drawable/app_icon" android:label="@string/app_name" android:theme="@style/UnityThemeSelector">
    4.     <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name">
    5.       <intent-filter>
    6.         <action android:name="android.intent.action.MAIN" />
    7.         <category android:name="android.intent.category.LAUNCHER" />
    8.       </intent-filter>
    9.       <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    10.     </activity>
    11.     <!-- Adjust START -->
    12.     <receiver android:name="com.adjust.sdk.AdjustReferrerReceiver" android:permission="android.permission.INSTALL_PACKAGES" android:exported="true">
    13.       <intent-filter>
    14.         <action android:name="com.android.vending.INSTALL_REFERRER" />
    15.       </intent-filter>
    16.     </receiver>
    17.     <!-- Adjust END -->
    18.     <!-- Share START -->
    19.     <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.sevenpointred.expanse.fileprovider" android:exported="false" android:grantUriPermissions="true">
    20.       <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths" />
    21.     </provider>
    22.     <!-- Share END -->
    23.   </application>
    24. <!--<uses-feature android:glEsVersion="0x00030000" />-->
    25.   <uses-permission android:name="android.permission.INTERNET" />
    26.   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    27.   <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    28.   <uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE" />
    29. </manifest>
     
  11. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    155
    I'm wondering if it's a cert signing issue. I extracted META_INF/CERT.RSA from a development build apk, and used
    keytool -printcert -file CERT.RSA
    to look at the fingerprints. The SHA1 was different to the SHA1 produced when I use
    keytool -list -keystore myprodkeystore.keystore
    . If I make a non-development build, the SH1 matches.
     
  12. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    155
    AH
    HA

    We had added a gradle template, so we could do multidex. Turns out the default template does not include signing for development builds. I added
    **SIGNCONFIG**
    to the debug section of buildTypes, and now my sha1s match and everything installs consistently.
     
    JuliusM and Yury-Habets like this.
  13. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Thanks for sharing your findings!
     
  14. SevenPointRed

    SevenPointRed

    Joined:
    Feb 3, 2016
    Posts:
    218
    I know this is old but I'm back to having this issue now that unity is moving to gradle by default.
    I can't get things like google play games to authenticate existing users as the signature has changed, so people could lose access to their accounts if I swap to grade.
     
  15. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    What is the issue you are experiencing? Is it when you install from Play, or locally? If you are signing with the same key - why would it be update incompatible? (I can only imagine v2 signature being an issue, however it's for the good if you change to v2).
     
  16. SevenPointRed

    SevenPointRed

    Joined:
    Feb 3, 2016
    Posts:
    218
    Installing locally, I get INSTALL_FAILED_UPDATE_INCOMPATIBLE if I try to overwrite.
    If I uninstall and build+run then it will install fine but any validation on the google play services returns a different result, meaning logins break.

    I've not uploaded to play as I dont want people to lose access.
     
  17. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Is it release or dev build?
     
  18. SevenPointRed

    SevenPointRed

    Joined:
    Feb 3, 2016
    Posts:
    218
    Both.
    Though installing dev over release will give an error about a duplicate manifest entry ( even though there isn't one, I checked the apk and its the same build either way ) That issue seems to be due to the fact it's not installing over the old version.
     
  19. SevenPointRed

    SevenPointRed

    Joined:
    Feb 3, 2016
    Posts:
    218
    I'm not so worried about dev builds, but i cant trust that a release build on play wont break everyones login
     
  20. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    You can probably try releasing to an alpha channel in Play to make sure.