I am trying to install an apk file on my Android device using ADB with the following command:
E:\adt-bundle-windows-x86-20131030\sdk\platform-tools>adb install -r WebserviceA
ctivity.apk
But I get this error message:
158 KB/s (225399 bytes in 1.391s)
pkg: /data/local/tmp/WebserviceActivity.apk
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
Before put your question in stackoverflow just do some googling i'm sure you get something very useful.
Anyways,
try like this
uninstall the existing .apk
and then
re-install the new .apk
Googling your error message can be very succesfull:
It means the new copy of your application (on your development
machine) was signed with a different signing key than the old copy of
your application (installed on the device/emulator). For example, if
this is a device, you might have put the old copy on from a different
development machine (e.g., some other developer's machine). Or, the
old one is signed with your production key and the new one is signed
with your debug key.
https://stackoverflow.com/a/3185824/1683141
So you need to make sure your application is signed with same key as the currently installed application. Note that a debug key is different from a regular key.
If you do not have your old signing key anymore, then you should remove your old application first.
Related
I upgraded my Android studio to 1.4. Now when I'm deploying my app to my device I get the message that the device has an application with the same package but a different signature. How is this possible? I already did some research and I looked up my debug.keystore, but this hasn't changed since 13/03/2015. Anyone has any idea how I can fix this?
The problem is the keys that have been used to sign the APKs, by default if you are running directly from your IDE and opening your Emulator, the APK installed in the Emulator is signed with your debug-key(usually installed in ~/.android/debug.keystore), so if the previous APK was signed with a different key other than the one you are currently using you will always get the signatures conflict, in order to fix it, make sure you are using the very same key to sign both APKs, even if the previous APK was signed with a debug-key from another SDK, the keys will definitely be different.
Also if you don't know exactly what key was used before to sign the apk and yet you want to install the new version of your app, you can just uninstall the previous application and reinstall the new one.
for more info go through This
Hope this Helps...
Debug builds are signed with the SDK keystore which is generated when you install the Android SDK. On Linux / OSX it is located at ~/.android/debug.keystore.
The message you had means that you have a debug build installed and you want to install an App Store build on it (or the other way around).
This can also happen when you deploy from a different machine.
when I updated my android app i got the following error message:
Re-installation failed due to different application signatures.
You must perform a full uninstall of the application. WARNING: This will remove the application data!
Please execute 'adb **' in a shell.
Launch canceled!
I personally got no problems with that but my question now is ... if I export the apk with the same keystore I used for previous updates. Is the app update a simple download for my users ?
Or will they have any problems with it ?
Btw: I didnt format my computer or changed anything about my eclipse folder or my folder where I save my keystore etc.
Thanks in advance!
Greets
Is the app update a simple download for my users ?
Only if it was signed by the same production signing key as you used originally, which would not appear to be the case here.
I didnt format my computer or changed anything about my eclipse folder or my folder where I save my keystore etc.
Despite that, you attempted to update an APK with one signed by a different signing key (e.g., debug vs. production). Use jarsigner -verify -verbose -certs ..., where ... is the path to your APK, to dump signing information, so you can compare your old APK to your new one.
I am working with IntelliJ IDEA 12.0.4.
I have repeatedly received the INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES message when installing my app to my emulator and my phone.
I believe the error came at the time my debug.keystore expired, and I solved the problem on the emulator by uninstalling the old version.
However I do not want to uninstall the app on the phone as this will delete user data.
I have also tried signing the app with my release key and then install that on the phone (by copying the APK file and executing it) - but that install was also rejected for certificate reasons. Shouldn't that be OK?
What should I do?
PS: For the avoidance of doubt - I have only one development PC, and only one certificate...
Android has no way of knowing that your debug key is related to your release key.
If your app has access to the SD card, you can use a command prompt to copy your data files to the SD card using something like this.
adb -d shell
run-as <packagename> sh
cp <files> /sdcard/
Your phone does not have to be rooted to do this, but run-as only works on the debug version of your app.
The phone doesn't know whether something is a release or debug key. It just knows it's signed with a key. So no, you can't update a debug signed copy with a release signed copy unless you use the same key for release and debug.
There's no real way around an uninstall here. If your phone is rooted, you can pull the files off and restore them after the new install.
The old installed .apk has different certificate than the new going to be installed.
So the solution is:
uninstall the existing .apk
and then re-install the new .apk
I've been working on some updates to an existing application I have in Google Play. The newer version of the application makes some changes to the application database. The problem I'm having is that I can't figure out how best to test the new update. Eclipse signs my "devel" package with debug.keystore (I presume) while the installed application from GP was signed with my release.keystore so I get the error message "Re-installation failed due to different application signatures” when I try to "run" my changes within Eclipse for debugging.
It's weird because I can download the 'release' apk from my company website and side-load it. This seems to ignore the signing even though the apk from GP and the one side-loaded are the same file.
If I go into Eclipse's Windows > Preferences > Android > Build and enter my release.keystore in under "custom debug keystore" (to get around the key signing descrepency) then Eclipse just complains the "Keystore was tampered with, or password was incorrect" so that route is out as well.
I'd really like to be able to test a 'real world' update before pushing the new apk to GP. Is there anyway to do this?
Export the apk signed with your release key and use adb install -r myapp.apk to update it on a device that has the older version installed.
Things to know:
I'm kinda new to programming
I have installed Eclipse with the Android platform loaded on my Macbook Pro
I have 2 PCs as well for further troubleshooting and flexibility
I commissioned a developer to port an iOS app to the Android platform. I did not build the app myself, I paid to have other people do it. I was able to run the avd and emulator and install/uninstall/reinstall with success through the adb protocol. Now I'm on to sign the APK for release in the Android Marketplace, except that's where I'm stuck. I have attempted and researched the hell out of this to no avail. I think the issue I'm running into is the materials I find are outdated.
Methods I've tried:
Using command prompt on my PC, I used the keytool command via the instructions here and was able to get through the first half, but when prompted for the second half I kept getting "cannot find jvm.dll". This guy had a similar issue, but no instructions on how to solve it, which he did apparently. NOTE: I did not find jarsigner.exe in ANYWHERE on any of my computers. I downloaded it from a website. Could be corrupt or invalid I suppose. Could never get a signed APK.
I found "signapk.rar" from this site and it actually seemed to work. I followed the instructions to a T and it produced the signed APK like it was supposed to. The problem was when I attempted to upload it, the Marketplace told me it expired before the 2033 date, whatever that was. So I assume that the code in this program had a validity entry that was large enough. I don't know how to change that, if that is the issue.
I came across Portecle just yesterday and was able to create a keystore and a certificate. I know where they are in my directory, but I don't know how to use that to sign the APK. It's terribly confusing.
Signing in Eclipse. This is the least successful method because I can't for the life of me figure out how to work the damn thing. I know I can't just 'import apk' and it work like magic, but that'd be great if it did. I created a new project and imported the file system after changing my APK to a ZIP. One time it imported the manifest and the other time it didn't do anything. I'm certain it's user error.
I understand if this were an easy process, everybody could be a developer. That's obviously not the case, so I'm trying to figure it out on my own while my developer is out of the country. Any and all help is appreciated.
Assumptions:
Assuming you have the keystore (private key to sign the apk) already generated by you.You can use the command line to do the signing without eclipse or android studio if the yourApp-unsigned.apk is already generated by your vendor or you
You are Using Windows for the below steps
Signing the apk:
Add the path for your jdk bin to your system variables (if you don't know how to do, that look for it its easy search for how to add path to windows system variables)
This is my jdk path (use yours)
C:\Program Files\Java\jdk1.8.0_25\bin
open Command Line and type the below using your App apk and keystore key
jarsigner -verbose -keystore c:\users\android\myAppKeyStore.keystore
c:\users\blabla\Desktops\myAppAPK.apk my_keystore_alias
if success, it will promote you to enter key phrase/password of your private key (the one used for your private key generation which you should know)
Verify it was signed Successfully using the command line
jarsigner -verify c:\users\blabla\Desktops\myAppSignedAPK.apk