How to Resolve APK Installation Error: Conflicting Package Signatures: Difference between revisions

From wizarPOS
No edit summary
No edit summary
Line 1: Line 1:
When installing APK, if you encounter the error message: "An existing package by the same name with a conflicting signature is already installed." There are three possible reasons:
== Error Explanation: ==
# There is an APK has been installed, so if you install an APK has same package name and different signature, it will notice to you, and forbid the APK to install.  
"An existing package by the same name with a conflicting signature is already installed", this error occurs during APK installation on Android systems for smart POS devices. It indicates a signature conflict with an already installed package of the same name. There are three primary reasons for this error:
# APK has not be signed.
# '''Duplicate Package with Different Signature:''' A different APK with the same package name but a different signature is already installed on the device.
# APK is signed, but the certificate is just the debug key or it can not be authenticated by APP root certificate of terminal.
# '''Unsigned APK:''' The APK you are attempting to install has not been signed.
 
# '''Invalid Signature:''' The APK is signed, but the signature is either a debug key or it's not authenticated by the terminal's root certificate.
== Solving Steps==
== Resolution Steps: ==
* To reason 1, please remove the installed old APK, then you can install the new one.  
# '''For the First Reason:'''
* To other reason, please apply certificate from wizarPOS. Please refer to [http://sdkwiki.wizarpos.com/index.php/How_to_apply_app_certificate How to apply app certificate]
#* Remove the previously installed APK.
* Check your key store
#* Then attempt to install the new APK.
    Use the command: keytool -list -keystore xxxx.jks -v
# '''For the Second and Third Reasons:'''
    If the keystore is correct, it should include the certificate the issued by the terminal owner. The default terminal owner is WizarPOS, so if you applied from WizarPOS, your certificate list should include a certificate which issued by the issuer "Issuer: EMAILADDRESS=support@wizarpos.com, CN=releasetestv1, OU=Testing, O=wizarpos, L=Shanghai, ST=Shanghai, C=CN", the result is like the right picture:
#* Obtain a valid certificate from WizarPOS.
[[File:Keystorelist.png|none|500|left|caption]]
#* For detailed instructions, refer to the guide on [http://sdkwiki.wizarpos.com/index.php/How_to_apply_app_certificate How to Apply App Certificates].
 
# '''Verifying Your Keystore:'''
 
#* Run the command: keytool ''''-list -keystore xxxx.jks -v''''.
* Check the alias name of the private key
#* Ensure the keystore includes a certificate issued by the terminal owner (default is WizarPOS). For example, a certificate from WizarPOS should have the issuer details like "EMAILADDRESS=support@wizarpos.com, CN=releasetestv1, OU=Testing, O=wizarpos, L=Shanghai, ST=Shanghai, C=CN".
    If your key store includes some private keys, please select the right private key with alias name, the private key is that be paired with the applied certificate.
#: [[File:Keystorelist.png|none|500|left|caption]]
 
# '''Checking the Alias Name of the Private Key:'''
== Notice==
#* If multiple private keys exist in your keystore, ensure you select the one that pairs with the certificate you applied for.
If you use an IDE tool to sign your app, please don't use the default IDE key store. You must use the key store that you have created and applied certificate.
== Important Notice: ==
When using an Integrated Development Environment (IDE) tool to sign your app, avoid using the default IDE keystore. Always use a custom keystore for which you have obtained a certified signature.

Revision as of 20:36, 8 January 2024

Error Explanation:

"An existing package by the same name with a conflicting signature is already installed", this error occurs during APK installation on Android systems for smart POS devices. It indicates a signature conflict with an already installed package of the same name. There are three primary reasons for this error:

  1. Duplicate Package with Different Signature: A different APK with the same package name but a different signature is already installed on the device.
  2. Unsigned APK: The APK you are attempting to install has not been signed.
  3. Invalid Signature: The APK is signed, but the signature is either a debug key or it's not authenticated by the terminal's root certificate.

Resolution Steps:

  1. For the First Reason:
    • Remove the previously installed APK.
    • Then attempt to install the new APK.
  2. For the Second and Third Reasons:
  3. Verifying Your Keystore:
    • Run the command: keytool '-list -keystore xxxx.jks -v'.
    • Ensure the keystore includes a certificate issued by the terminal owner (default is WizarPOS). For example, a certificate from WizarPOS should have the issuer details like "EMAILADDRESS=support@wizarpos.com, CN=releasetestv1, OU=Testing, O=wizarpos, L=Shanghai, ST=Shanghai, C=CN".
    caption
  4. Checking the Alias Name of the Private Key:
    • If multiple private keys exist in your keystore, ensure you select the one that pairs with the certificate you applied for.

Important Notice:

When using an Integrated Development Environment (IDE) tool to sign your app, avoid using the default IDE keystore. Always use a custom keystore for which you have obtained a certified signature.