INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES - android

I know this question has been asked so many times here on the StackOverflow and the solution for this problem was given as "Uninstall previous version and then install"
My Problem:
I have made an app for the client and shipp that apk to him he has installed it on his devices. I have delivered him 3 to 4 APK. and all he need to do is to get the Apk and install them (this is a procedure I have made in app by downloading newest version from my server and then installing new version using installer)
Now for some reasons I have to uninstall and intall my Android studio. I also did upgrade it to new version 3.1. Now that I have to make some changes and I have to ship the new APK in debug mode. I have shipped the APK. but its just not getting installed on client devices. Also I can generate same case on my device.
I can not afford to let the client to do this work (uninstall previous version and then install the newer version)
What I found on internet? I got to know after doing some research on internet. And that is the debug.keystore is the problem. All apks needs to be signed with same certificates and keystore. I have read that its the case with the realsed version of APK but I wonder if it is the case with the debug apk too.
Any Solution ?
Now please tell me If I can get my previous keystore? can I get any thing from previous debug APK ? any solution and work around except installing and uninstalling APK ???? please help
Note:
For some reasons I have not made it release version and I also did not upload it on the server.

You should probably make a keystore(link here) and back it up somewhere safe for all your future releases. Then if you sign it from the same keystore for future builds, you should not run into these issues.
There shouldn't be a reason to ship debug apk unless your client has a specific request because the they are as the name suggests open to debugging by potential attackers.
You should also check proguard if you care for security of your apks

Related

Firebase App Distribution APK will not install

I'm using the Firebase App distribution to send out updates to a few testers and the most recent APK I uploaded will not install on Android devices (actually it is several new versions that all have issues installing). I had previously uploaded a version that worked, but all subsequent updates fail with an 'App not installed' error message. I'm confused by the APK files that are generated from Android Studio and I don't recall which version I previously uploaded that worked. In the apk folder there is a debug folder that contains an apk file named app-debug.apk. I'm pretty sure this is the one I used with the successful version of the distribution. There is also a flutter-apk folder with an identically named file app-debug.apk. Does anyone know the difference between these files and which one I should use? That question is a side note as neither of those files work.
I have tried telling my testers to uninstall the previous (working) version and then try to update their Android with the latest version, but the error still occurs. I do not have any issues with my iOS version and that test group.
Do I need to update the debug.keystore file? I have searched many different threads for a solution and nothing seems to work. Any suggestions to debug the issue would be appreciated.
On Android, if the package exported by debug cannot be installed on some devices, such as "parsing failure", you can add a signature file to the debug version. It is better to generate it yourself, and do not use the tool's own. In addition, you can add a signature file to the debug version androidmanifast.xml Statement under application android:testOnly= "False", which may help you

Can not install my own generated apk

I updated my app and tested it on my device. Everything works fine if I test the app via the run button in eclipse but if I export it into an apk and try to install the apk it fails.
There is no error code or anything else, it just says the app has not been installed.
Any idea why this happens? I only changed a few things in my app: I removed the basegameutils lib from my app and migrated to the new api without basegameutils. Thats it (except for some bugfixes but that can not be the cause).
I did already restart eclipse and cleaned all projects mutiple times.
The target sdk is 22 and I am using newest system images and so on for that api level (my divce is a stock nexus 6 with 5.1.1 running). I also updated my build tools to 23.0.1 from 22.0.1 and removed the 22 version. Is this the cause?
I also tried to upload the apk in the dev console and there were no erros.
Thank you for your help.
EDIT:
The logcat output says the signature does not match the previously installed version.
If i try to install the current live version via the play store there is also an error message saying i can not install this app because another user already installed an incompatible version on this device (but i dont have it installed and i dont have multiple users on the device).
If i got to the app menu in the settings my app is shown at the bottom of the list but there is a note saying the app is not installed for the users. If i click on it all buttons are unclickable (so i can not uninstall it).
What is happening?
For me, selecting Signature Version v1 and v2 both solved the problem
Your signature changed, so as you mentioned you must uninstall the previous version. You tried to uninstall from the device UI and that fails - so try it from the command-line:
adb uninstall your_package_name
Seen on Nexus devices, occasionally only command-line uninstalls work.
I found a solution but I still have no idea what caused the problem.
somewhere on my device my app was still installed even though it didnt show up in the app drawer and the play store told me the same. In the settings/apps menu my app was still present (as i mentioned in the edit of my original post) so i clicked on it. If you click on the menu button you can chose unisntall for all users which did the trick. now I can install my apk again.
I have no idea how this happened but there you go, i hope this helps.
EDIT:
I had the same problem as this guy had. the accepted answer over there is much nicer than my poorly foramtted text ;)
"You cannot install this app because another user has already installed an incompatible version on this device"
I was facing same problem And I solved it this way, For Current Updated Android Studio 2.3
Build > Generate Signed apk.
Create Keystore path.
Put Password, alias, key password.
Build type select accordingly(eg to release in playstore use release).
Signature Version select both V1 and V2 checkboxes.
Finsih.
Go to the apk from explorer and use it for your playstore or in devices as Signed and Certified apk file.
For me the solution was to disable Play Protect on device.
You can not run signed apk directly in your android device .
I you want to run your apk then follow below steps :
1) Go to your device settings
2) In setting you find applications
3) In application checked unknown sources
This will allow you to run your signed apk without downloading from play store.
or
try this link :
"You cannot install this app because another user has already installed an incompatible version on this device"
The problem is because you have a version of your testing app. So, you're not really upgrading the app! Those are two different apps. You must first uninstall previous version (testing) so you can install the release (signed) version of your app.
I encountered this problem today and tried a few suggestions here, and this is how I solved the issue: I cleared my phone's caches / junk files and also uninstalled the test versions of the app and their APKs, and then reinstalled the new APK. Try this first before getting worried. 🙂
I got the save Error just incase someone faces this. For me it was because i have multiple projects for the same app on the phone. you need to delete older versions of the app from your phone.
If you have two options (V1 (jar signature) and V2 (Full APK Signature)) before generation signed apk. you should use V1 jar signature now, because there is no backward compatibility and all android phones with version < 7 won't accept this signature. Backward compatibility will be added in some next N Developer Preview.
There are also explanations on this developer.android in this link :
https://developer.android.com/about/versions/nougat/android-7.0#apk_signature_v2
In my case it was the proguardFiles path in build.gradle that caused this problem
Currently PlayStore performs regular checks for apps and device for harmful behavior. Installing signed APK manually is treated like unusually behavior so is preventend.
So turn off play protect feature temporary and your install will work as charm!
step one - open play store and select play protect
step two - click play protection setting button
step three - disable
step four - close and install your APK manually

Can INSTALL_FAILED_UPDATE_INCOMPATIBLE cause issue with release version?

Recently I updated my windows (from 8.1 to 10). After working on my app that I used to debug on 8.1, when I try to run from w10, I get INSTALL_FAILED_UPDATE_INCOMPATIBLE. Now I assume this is caused by different fingerprint of new Windows version, the debug version was signed by previous one and they dont match.
My question is : can this cause problem when building a release version too? Will the data of my users be wiped by this or the keystore will take care of that (because they release keystore didnt change therefore on deployed devices it wont complain)?
As long as you are using the same release keystore, then the release version will work to upgrade the current application, and no data will be lost. If the keystore changes, you cannot upgrade the application, and any new version would require a complete uninstall of the old one.
Also, if your application is on the Play Store, you would not be able to upload the APK anyway if the keystore did not match, so the error will be caught before it gets to users.

Re-installation failed due to different application signatures

I am getting the above error message when I try to debug an application that is already installed. Most others who run into this seem to be developing on different machines with different key files, but I am doing everything on the same box.
My issue is that I am testing my database upgrade process (i.e. what the onUpgrade() method of my SQLiteOpenHelper extension does). For this, I would like to try the upgrade on top of a variety of older builds. These builds are available as signed application packages. When I deploy such a package to a fresh emulator and then try to debug the current version on top, I get the error in the subject line. I think that this is because the debug deployment packages are unsigned, and the currently installed package is signed. Again, I know that the error goes away if I unstall the currently installed app, but then I cannot test the upgrade.
I do not want to go through the effort of switching back my dev environment to older build versions, so that I can build unsigned packages for these versions. I may not even be able to do this, because I switched source code repositories recently and lost some of the history.
I believe that if I were able to get Eclipse to generate a signed package for debugging, it should work. Alternatively, I could manually deploy a signed package and launch a debug session without a build/deployment step, but I have not been to figure out if this is possible, either. What can I do?
Edit: The Android documentation was helpful in figuring out how to sign a package with the debug key, but this does not help me, because I need to debug with a private key. I suppose that this is not possible.
You can sign current package with release key, install on device, run the application and connect debugger in Eclipse. How to connect debugger: in the DDMS perspective on the Devices view select your application and press button with "green bug":
I'll post it as an answer:
You should generate them all with one signature - otherwise it wont work. only uninstall and fresh install will work with different signatures. http://developer.android.com/guide/publishing/app-signing.html also taken from there:
Eclipse Users
If you are developing in Eclipse/ADT (and have set up Keytool and Jarsigner as described above in Basic Setup for Signing), signing in debug mode is enabled by default. When you run or debug your application, ADT signs the .apk with the debug certificate, runs zipalign on the package, then installs it on the selected emulator or connected device. No specific action on your part is needed, provided ADT has access to Keytool.

Android - Issue with .apk file

I do understand that a .apk file is created in the bin folder of an android project, when the project is run.
I have a question about this: is it possible that there would be any difference in the functionality of an app installed via eclipse (as in connecting the phone to the computer and uploading and installing the app on the phone) versus installing the app by downloading a .apk placed on a secure server?
The reason I ask this question is that I usually put up the .apk file on a secure server and the testing team downloads and installs the app for testing purposes. The testing team has started to report app crashes when accessing this app. However, I don't seem to be seeing the any such problems (even while replicating the same scenarios) with the app when I install it on the phone via a cable connected to the computer.
You might be falling into a caching issue. Make sure you get the QA team a new filename of the apk on the server to ensure that they never get a cached apk when downloading it. Also maybe create a md5 sum of the apk locally and run md5 on the apk on the server after upload to ensure it is the same.
e.g. use
md5 yourapk.apk > yourapk.md5
on your machine and the server..
Most likely you QA team has found issues that are specific to the device or Android platform version they test with. Try with your apk with the same hardware in your dev environment.
I don't see how that would possible. The Eclipse ADT plugin just calls the executables in the specified Android SDK location on your hard drive and the .apk gets generated only once when you use Eclipse to install the application to your plugged phone.
Unless you're packaging the two versions in a different way, that shouldn't be possible. My guess is that your testing team has just found bugs specific to the runtime environment (the phone). Maybe a different version of Android, conflicting custom ROM, etc.
No, there is no difference , if the apk on the secure server is as latest as you have on your computer.
I would recommend you to clean your project before uploading the apk to the server.
Regarding the crashes, i guess there are some location based problems.
Also check if you are uploading the apk from your workspace. or some other older version which is located in different place that you are not using anymore.

Categories

Resources