2

I have trouble with updating the debug version of the app's apk:

Installation failed with message Failed to finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package [here our package] signatures do not match the previously installed version; ignoring

Two developers. Two PC's with same Android Studio versions (3.2.1). But when I try to install - have this, when the second developer make a debug apk with the same code (with git) it installs normally. If I make an apk - it's an error occurred via an update of a version of the second developer on a different device (tester).

What I've tried already:

  • Restart Android Studio.
  • Clean and Rebuild.
  • Invalidate Caches and Restart.
  • Build apk and installed from the device. ("Application doesn't install" error occurred during update)
  • Increase versionCode.

The device is a Lenovo TB-X103F tablet on Android 6.0.1.

Jake Lee
  • 7,549
  • 8
  • 45
  • 86
Artem Winokurov
  • 182
  • 2
  • 12

2 Answers2

3

You need to use the same debug keystore. Your colleagues' keystore will be at:

  • Windows: C:\Users\USERNAME\.android\debug.keystore
  • Linux / Mac: ~/.android/debug.keystore

3 solutions are below in descending order of correctness:

  1. In the long term, this should be configured inside your project, so that anyone with the project can sign the debug builds. This is done by configuring your build.gradle like so.

  2. You can also set your signing config inside Android Studio, so you are not reliant on copying his file in the future. Here is how to set it.

  3. You could also just replace your debug keystore in that location with your colleagues, so you are using the same config.

Jake Lee
  • 7,549
  • 8
  • 45
  • 86
  • Strange thing but it works! "You could also just replace your debug keystore in that location with your colleagues, so you are using the same config" – Artem Winokurov Jan 22 '19 at 11:27
1

Different keystore files cause this warning. For the exact solution;

-Create your own keystore files for each build types.

-Define buildTypes and SigningConfigs in app level gradle file like this:

signingConfigs {
    release {
        keyAlias '******'
        keyPassword '******'
        storeFile file('...\\release.jks')
        storePassword '******'
    }

    debug {
        keyAlias 'alias'
        keyPassword '******'
        storeFile file('...\\debug.jks')
        storePassword '******'
    }
}
buildTypes {
    release {
        lintOptions {
        }
        debuggable false
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.release
    }

    debug {
        debuggable true
        minifyEnabled false
        signingConfig signingConfigs.debug
    }
}

NOTE!!! You can move debug keystore file into project folder(app folder will be a good choice). So both developers have the same keystore easily.

serefakyuz
  • 273
  • 4
  • 14