androidreact-nativeapk

INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package signatures do not match the previously installed version; ignoring


I get this error when trying generate a debug apk for update an app directly on the device (Android - React Native):

Execution failed for task ':app:installDebug'.

com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package prensa.com signatures do not match the previously installed version; ignoring!

Im sure that version code and version name were incremented and the package name is the same.

Also, the keystore and other keys are same used before.

Where is the error?


Solution

  • I met the same error today.And I found thishttp://blog.bihe0832.com/android-v2-issue.html.It's in Chinese.The key points describe below:

    After package your apk file, unzip it,check the file META-INF/ANY-NAME.SF.I sign the apk with jarsigner command line tool.I found that the alias putted after the jar-file when exec the jarsigner, will used as the ANY-NAME.Then open the ANY-NAME.SF, if you found a line of X-Android-APK-Signed: 2,That's the cause of the error.Resign your apk,if the line of code gone, the apk will be installed success.