Application Update Fails - Inconsistent Certificates (..but not really) - android

I have already published 5 updates for my application without any problems. Now, when trying to install an update for testing purposes the installation fails. Through the regular Android package installer I get the error "Application not installed."
When trying to install the application through adb I get the error:
[INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
I know for a fact that the certificate is the same one I've used to sign the app before.
I have also incremented the versionName and versionCode accordingly in the Manifest file.
The only thing that has changed since my last update is that my hard drive crapped-out on me, which led to re-installing eclipse, ADT, Android SDK, and Java. I basically had to set up the entire development environment again after the crash.
Everything, including all of my project files, were backed-up. I can build my application just fine.
Installation works if I uninstall the previous version first, but this is an update for an app that I currently have published. I can't ask the users to uninstall whatever version they currently are using to take an update. That sounds silly.
Any ideas would be helpful.

I think you need double confirm whether you use the same certificate or not since we ran into the same scenarios many many times and the root causes are always the same: the certificate changes.
you could simply unzip the .apk file since it is just a regular ZIP package and then locate the file META-INF/CERT.RSA. the CERT.RSA should NOT be changed in all your .APK files. to confirm, decrpt it as following:
openssl pkcs7 -inform des -in CERT.RSA -out decrypted.txt -print_certs -text
and you could simply run diff on the .txt files.

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

Building an Android APK with same certificate as the system

I'm trying to make a system app work. Here's what I have:
An OEM OMAP platform with full 4.4.2 source code. I've built the system and loaded on my platform using Ubuntu 14.04. That all works.
Now, there is an app from the OEM which directly accesses the hardware (DSP, I2C, UART) etc. The original APK that came from the OEM works on my platform.
I built the exact same app using make command (not using Eclipse); It builds and I can install on the platform. But when I try to launch the app, it gets stuck in an eternal wait state.
I am not sure, but I suspect my locally built app tries to initialize a hardware component on the board and then gets blocked there.
I've been reading articles all over, and seems like it has something to do with the app signing and certificate. I think the general idea is the app needs to be signed with the same certificate with the system itself. I thought, since I built both the app and the system on the same machine using same commands, they would have a same certificate.
If it helps, the manifest file has this line:
android:sharedUserId="android.uid.system"
And the project make file Android.mk has this line:
LOCAL_CERTIFICATE := platform
Can anyone show me how can I make the app work? I am not sure, seems like I have to rebuild the app with proper certificates so that it can access all the hardware resources.
Thanks.
Check signing system apk.
Optionally:
You need to create a keystore file by using keytool-importkeypair which you can find here.
Go into the: build/target/product/security/ directory in your platform source tree (source codes related to your Android version and vendor).
You will find platform.pk8 and platform.x509.pem files.
Create keystore file by using this example command:
keytool-importkeypair -k ~/.android/debug.keystore -p android -pk8 platform.pk8 -cert platform.x509.pem -alias platform
You can use this keystore file to sign your apk which will have system permissions afterwards.

Why will my signed apk not install?

I have been developing my app for a while and runing on a real device through Eclipse using Run As -> *Android Application*.
Now I am trying to distibute it to some beta users for the first time.
I used Eclipse to create a signed app, using a new keystore that I generated through the wizard. This appeared to work fine and when I check with Jarsign I get the message "Jar Verified", although there are a couple of warnings too. These are "This Jar contains entries whose certificate chain is not validated" and "Ths Jar contains signatures that do no include a timestamp".
I then copied the resulting apk onto the device and opened it. But got a message "This app was not installed". And in log cat I can see:
"Package has no certificates at entry ; Ignoring!"
I found some people had suggested going back to JDK 6 (I did have 7 previously), but that didn't help.
A few people suggested it might be due to duplicate activities in the manifest so I checked the manifest thoroughly.
What I have found is that if I rename the apk so that it is no longer exactly the same name as the last part of the package it suddenly works.
So if the package is com.mydomain.myapp and the apk is myapp.apk I get the error, but if it's myapp_debug.apk it installs just fine.
I find this very confusing and more than a little worrying. I would like to publish this app for real eventually and I'm not sure if I've done something wrong.
Based on your renaming makes it work description, you already have an app with the same package name installed on the device, but signed with a different certificate (probably the debug certificate used for eclipse-launch installs).
You must simply remove the existing installation before you install your release version. You can do that either from the settings menu, or with an ADB command of the form
adb uninstall your.package.name
Note that this removal will wipe out the private data stored by the app - that's part of why you have to do it, to prevent an imposter (naturally having a different certificate) from easily grabbing data left behind by a real app.
Remember also when distributing apps to others in this manner that they will need to allow unknown / non-market sources in their settings menu.

Issue Importing .APK into Eclipse

I created a .apk outside of eclipse using tiggr mobile (http://gotiggr.com)
i have the downloaded .apk and need to sign it - so i thought about running it through eclipse then signing it that way
im having the worse trouble importing it into eclipse.
does anyone have any other suggestions on signing this? i keep getting this message when uploading:
Market does not accept apks signed with the debug certificate. Create a new certificate that is valid for at least 50 years.
Market requires that the certificate used to sign the apk be valid until at least October 22, 2033. Create a new certificate.
Market requires the minSdkVersion to be set to a positive 32-bit integer in AndroidManifest.xml.
thanks for your help!
It would be faster to get the source code into eclipse via retyping it than to try and unsign and explode the apk, edit the manifest, fool the tools and sign the package. The tools can be run at the command line anyways and eclipse would just make it harder.
One problem you have is that there are problems in your manifest. The market requires some attributes set in it that you did not need while doing developer builds. You can open up the apk with anything that will open a zip file. You can edit text files with notepad. You package them up with ant by recreating the build.xml by hand. The instructions for signing things is here:
Android Dev-Guide: Signing your Applications
But what a LOT of work... and I am guessing you will need to do this multiple times just for one release to get the manifest right. Then what do you do when you need to update your program?
Will the service not let you export the code in an easy to use way (because... wow... talk about evil)? Failing that cut and paste will save you time but you will almost certainly want to have it in eclipse or some IDE ready to make changes for your market release and build, package and to sign it.
That's not your issue. I suppose you compiled your app and now you're trying to publish it in the market. To do that, you need a private key whick in turn requires you to have a android market developer account.
Normally you can develop your app and install it into most devices but you can't submit apps to android market without a developer account.
If what you really want is only to import your app to eclipse, I suggest you to create a brand new android project and copy everything into it. It's easier and faster than adjusting everything!

why won't apk file update

I'm developing an android app using Eclipse. I export the app using the Export Android App function. I sign and align the resulting apk file. I then copy this apk to a webserver and try to install it on my phone. It goes though the installation steps, and when I test the app it does not contain my latest changes. It seems to install one of my previous builds.
Is the problem in:
- the way I create the apk?
- a cache on the phone that has not been cleared?
How do I get Eclispe to make a current apk, and how do I get my phone to install it?
How can I verify which version of my code is in a particular apk file?
Thanks,
Gerry
It could be that Eclipse isn't building the new .apk properly, though it sounds like you're exporting correctly. Are you giving the new .apk a different name from the old one? If not, then you could be downloading or installing the old one by accident.
You should be able to go into Settings -> Applications -> Manage Applications on your phone, then find your app and open its info page. The version string should be listed near the top, so you can verify that the latest version is installed.
Try running "adb logcat | tee logfile" (or adb logcat > logfile) before you begin the install attempt, then ctrl-C it and go over the file with a fine tooth comb - there's likely some hints of the problem buried within the noise.

Categories

Resources