expo/expo-cli

Package signatures do not match previously installed version even using the same keystore

anarkrypto opened this issue · 1 comments

Summary

I use eas to launch my app on play store.

After installing from the Play Store on my emulator, I can't update it using expo run:android, even though I copy the eas keystore to my project and link with credentials.json

Changing the variant from debug to release doesn't work either

adb uninstall com.package.name solves, but I wish it wasn't necessary to remove the application, just launch a new release locally, reusing the state, before publishing.

I don't know if this is an Android limitation, but the error doesn't seem to make sense to me, since the keys used for signing are the same.

Environment

expo-env-info 1.0.5 environment info:
System:
OS: Linux 5.19 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 18.15.0 - /usr/bin/node
Yarn: 1.22.19 - /usr/bin/yarn
npm: 9.5.0 - /usr/bin/npm
Watchman: 20221211.114518.0 - /usr/local/bin/watchman
npmPackages:
expo: ~47.0.12 => 47.0.13
react: 18.1.0 => 18.1.0
react-dom: 18.1.0 => 18.1.0
react-native: 0.70.5 => 0.70.5
react-native-web: ~0.18.7 => 0.18.12
npmGlobalPackages:
eas-cli: 3.0.0
expo-cli: 6.3.2
Expo Workflow: bare

adb:
Android Debug Bridge version 1.0.41
Version 28.0.2-debian

Please specify your device/emulator/simulator platform, model and version

Google Emulator, Pixel 4 API 32

Error output

Error: adb: failed to install /home/user/android/app/build/outputs/apk/debug/app-debug.apk: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.package.name signatures do not match previously installed version; ignoring!]

Reproducible demo or steps to reproduce from a blank project

  1. Build with eas build --platform android, export to Play Store and install in your device ( I am using Android Emulator).
  2. Export your keystore.jks from your project Credentials in https://expo.dev/
  3. Save the file in your project root
  4. Paste your keyStorePassword, keyAlias and keyPassword in credentials.json in your project root
{
    "android": {
        "keystore": {
            "keystorePath": "keystore.jks",
            "keystorePassword": "xxxxxx",
            "keyAlias": "xxxxxx",
            "keyPassword": "xxxxxx"
        }
    }
}
  1. Increase your app.json expo.android.versionCode
  2. Run: expo run:android

Hi @anarkrypto! It's possible that you've installed a production build, using a different keystore than you would use locally (through expo run:android).

I would personally recommend using a different android.package for development/staging builds and for production. By doing that, you can install the production app (from the Play Store) and the development version side-by-side on your phone.

Hope this helps!