Unsigned Android apk file won't install - android

I created an unsigned APK file from my eclipse project to demo my app on another device. It runs fine on the emulator and on a connected phone.
When I emailed it and downloaded the apk file ( I have allow apps from unknown locations ticked on ) but the install fails with message. "Installation failed" and not much more info.
Any ideas what I can check?

Make sure that the o.s. version of phone on which you trying to install the app is meet the minSdkVersion that you declared in your manifest file. Or if that app is already installed then unistall that and install again. May be it works.

I had the same problem. It was solved by uninstalling the version I had installed via usb from Eclipse. Once that version was off my phone I could email myself APK's and they would load fine.

All your apps need to be signed. Read here:
http://developer.android.com/tools/publishing/app-signing.html
Sign it with something like jarsigner

On the device, go to Settings->Applications->Unknown Sources and make sure that is ticked.
Make sure that there is enough space on the phone, and that the phone is running on the right version of Android.
Finally, if this still doesn't work, then sign your .apk file.

I had the same problem and in the end just signed apks which let them install perfectly. Alternatively if you use something like astro of the play store to backup your apk from the phone running it and send it over to the other phone - this also works. I think it might not be packed right or for some reason it requires a signature to install. It could also be that conflicting signatures are found on the new phone.

Related

Installation failed with message INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES. not able to install any application in a particular device [duplicate]

I tried to reinstall an apk
$adb install -r new.apk
And it shows the error:
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
One solution is to uninstall and install the new.apk, that works fine.
But I'm wondering whether I could re-build an apk and re-install without the uninstallation. Eg. change some config in the AndroidManifest.xml, or not sign the APK, etc.
It would be great appreciated if you could tell me the whole meaning of the "INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES".
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.
I ran into this while testing on a new Xoom. I had previously installed my app from the Marketplace. Later while trying to test a new version of the app I ran into this error.
I fixed it by removing the app that was installed via Marketplace (just hold and drag to the trash). Thereafter I was able to deploy my development version without any issue.
This happened to me when another developer on the team built our app on the hardware device I was trying to deploy to. Uninstalling the app from hardware fixed my problem.
This is the command to uninstall the app from device using adb:
adb uninstall <package name>
I got this error even after uninstalling the original APK, which was mystifying. Finally I realized that I had set up multiple users on my Nexus 7 for testing and that the app was still installed for one of the other users. Once I uninstalled it for all users the error went away.
I changed the package name while coding an update so that I could debug it on my device via Eclipse, without deleting the old version that was installed. Without reverting the package name I was using when trying to reinstall, I got this same error. Using the same package name the reinstall was successful.
Just delete the old build from the device and reinstall the same. Because device.keystore is already exist in the device so just uninstall the build and reinstall the APK thats all..
Thanks
I faced an another use case where I got the similar error.
When At first I got the error, I panicked, and removed /data/data/{package.name}
After that I tried, and my problem was still present.
Then I tried uninstall, it failed.
I then removed the apk file present in /system/app (required root access), and tried uninstall and it was successfull.
After that I tried re-installing the apk, it worked.
If you encounter a failed deployment to an Andorid device or emulator with the error "Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]" in the Output Window, simply delete the existing app on the device or emulator and redeploy. Debug builds will use a debug certificate while Release builds will use your configured certificate. This error is simply letting you know that the certificate of the app installed on the device is different than the one you are attempting to install. In non-development (app store) scenarios, this can be indicator of a corrupted or otherwise modified app not safe to install on the device.
I had the same problem until I realised I had the simulator running and adb was trying to install on that
For what it is worth, I ran into this problem after adding a new plugin to my Cordova project. I had been having cordova do builds and install directly on the device via USB.
I fixed it by uninstalling the app from the device and on the next deploy there were no problems.
Nothing from above worked for me. The problem for me was that I had wrong source in my Java Build Path for android-support-v7-appcompat. When you go to Project> Build Path> Configure Build Path>. Under the Source tab make sure you have android-support-v7-appcompat/gen , android-support-v7-appcompat/libs and android-support-v7-appcompat/src and nothing else. Click OK and it should work.
I've had the same error today, but the problem wasn’t exactly the same. I’m using ADB with Android installed in VirtualBox. I tried to install different versions of my app (signed / not signed, debug / release mode) and got two errors alternatively : INSTALL_FAILED_UID_CHANGED and INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES.
Now, when looking at /data/data/{package.name}, I found a bunch of files that were still there after uninstalling the app. I tried to rm -rf them without success : I got I/O errors.
The solution to this was :
Shut down the VM
Mount the VDI image with vdfuse (read/write)
Repair the Partition1 image file with e2fsck
Umount and restart the VM
Since the verification is based on package's name, you can change the package name inside your config.xml or manifest file for another name you want.
When publishing your app don't forget to change back the name!
I had this problem trying to execute gradle task connectedDebugAndoidTest (or connectedAndroidTest) on Genymotion. Running it on normal emulator solved the problem.
I think , your app installed by other account.( multiple account mode feature ) You can uninstall app in Setting>Apps>"app name"> Uninstall

Test Android App over Remote Desktop

When I'm away from my computer, I like to use TeamViewer to access it and work on my Android apps. I save unsigned .apk files to my Google Drive so that I can test them while on the go, too. I download the .apk files to my Android device through the Drive app, but I'm having an issue.
When I go to install the App after downloading it from Google Drive, Android asks me if I'd like to install the App. When I click yes, it begins the install process but then exits with an "App Not Installed" error. There doesn't seem to be any other indication of what happened.
I've tried this with several of my .apk files, but they all give me the same issue. If it helps, these are apps I've previously downloaded by running the app with my android device plugged into my computer. I made sure to uninstall the app before trying to install it through the .apk file. I'm testing on a Google Nexus 7 32GB.
Any help would be much appreciated. Thank you!
To me, it sounds like you are trying to install an APK that is signed with a different certificate than the one installed on the device.
Run logcat, and you will see a message with information on exactly what is happening.
Have out tried installing your unsigned APK through ADB? This should let you see any errors there are in installing that APK, such as security settings.
According to a now-deleted(?) comment, you were trying to install an unsigned APK.
Alas, you cannot install an unsigned APK. Android -- emulators and devices alike -- only run signed APKs.
What comes out of the normal development process is an APK signed with the debug signing key, not an unsigned APK. There is a concept of an unsigned APK, but you have to go out of your way to create one normally, and it's usually just an interim step en route to signing it.

Android certificate (can not install app by using apk file)

I developed an Android app. I then transferred the bin/myapp.apk to my android phone, and try to install it. But my phone says it can not be installed.
Someone told me it is probably because of the Android certificate in my app is wrong.
But I do not understand what is Android certificate ? Is it something defined in AndroidManifest.xml ?
Android certificate refers to how your app was signed, if at all. You can create an unsigned apk, or sign it with a debug key, or a release key. If it's unsigned then you'll get an error when trying to install. Also, if you try to install a debug key-signed apk over a release key-signed apk, or visa-versa, it'll also fail. If you tell us what process you're using to build the apk then we may be able to give you more info.
Why are you transferring it to your phone like that? If you want to see the exact error you're getting, connect your phone to your computer and attempt to install using "adb install yourapp.apk".
You could also email the APK to yourself and open up the attachment to install. If you want see error messages, attach your phone to your computer and do "adb logcat", and then attempt the install.
You may want to peruse this:
Signing documentation
The very first thing I would check is that you allow Unknown Sources.
Settings -> Applications -> Unknown Sources, be sure this box is checked before looking into these signage issues.
Try the following:
Check the android:minSdkVersion in AndroidManifest.xml file. It should be in accordance with your device.
Try the signed APK.
Do first step as said by adorablepuppy...
Settings -> Applications -> Unknown Sources, be sure this box is checked before looking into these signage issues.
Secondly check minSdk in android.manifest. If minSdk version is greater than the vesrion in your phone than apk won't install it.
Nothing would be the issue with certificate... forget about the certificate...

Android Unsigned App not able to install on device

My app able run on simulator and I export it as Unsigned App.
On my phone's Setting-->>Applications--->>Unknown sources checked.
I download the .apk into phone storage through USB.
Then under File Manager, I found that stored .apk and hit install button and it try to install,
But finally it says Application Not installed. but why? wht's wrong?
Also I try ./adb install -r myapp.apk but it said error:device not found
I have never tested an app on a device by using your method... When I am NOT debugging on my device using usb and I just want to install it on my phone, I do the following:
If you have run it on the emulator then there is an .apk file in the bin directory of your project.
Move that .apk to your phone via usb or another method (I use dropbox).
Open the .apk and install on your phone.
The previous answers are correct, it must be signed. But by doing my method it will be signed with your debug key.
You will obviously want to actually sign it with a real key before publishing it to the market.
All applications must be signed in order to install on emulator or real device, check out the official dev guide signing your application:
All applications must be signed. The system will not install an
application on an emulator or a device if it is not signed.
To test and debug your application, the build tools sign your application with a special debug key that is created by the Android
SDK build tools.
Specifically how are you getting the APK to the device? Try dab install <path to APK>. Also, you can install APKs from the Android browser by uploading it to any web server and navigating to its URL.
You must export and sign with a debug certificate before installing. Read about publishing.
If you are using Eclipse, you don't need to export your app as "unsigned apk". Simply enable "Allow Unknown Sources" on the phone, and right click on project and hit "Run As".
Unsigned apks are generated by signing them with the debug.keystore key that's stored in the Android SDK. It could be possible that his key is corrupted. To verify, check to see if any other project also gives a similar problem. To resolve th key corruption, delete your SDK and install again (shouldn't take more than 15mins).
In case other projects work fine, which means your debug.keystorekey is NOT corrupt, you need to uninstall any previous versions of this app on your phone and restart your phone.
It could also be possible that the adb server could be messed up. In that case, restart your Eclipse or do adb kill-server from command line.
Also, seems like other people have faced similar issues. Did you search similar StackOverflow questions and try out the solutions? Here's one: 'App not Installed' Error on Android
Unsigned APK can be installed in real mobile devices for purpose of testing.
Just follow these steps on images:
Locate the APK and send it to your mobile through gmail etc..

How to deal with INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES without uninstall?

I tried to reinstall an apk
$adb install -r new.apk
And it shows the error:
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
One solution is to uninstall and install the new.apk, that works fine.
But I'm wondering whether I could re-build an apk and re-install without the uninstallation. Eg. change some config in the AndroidManifest.xml, or not sign the APK, etc.
It would be great appreciated if you could tell me the whole meaning of the "INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES".
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.
I ran into this while testing on a new Xoom. I had previously installed my app from the Marketplace. Later while trying to test a new version of the app I ran into this error.
I fixed it by removing the app that was installed via Marketplace (just hold and drag to the trash). Thereafter I was able to deploy my development version without any issue.
This happened to me when another developer on the team built our app on the hardware device I was trying to deploy to. Uninstalling the app from hardware fixed my problem.
This is the command to uninstall the app from device using adb:
adb uninstall <package name>
I got this error even after uninstalling the original APK, which was mystifying. Finally I realized that I had set up multiple users on my Nexus 7 for testing and that the app was still installed for one of the other users. Once I uninstalled it for all users the error went away.
I changed the package name while coding an update so that I could debug it on my device via Eclipse, without deleting the old version that was installed. Without reverting the package name I was using when trying to reinstall, I got this same error. Using the same package name the reinstall was successful.
Just delete the old build from the device and reinstall the same. Because device.keystore is already exist in the device so just uninstall the build and reinstall the APK thats all..
Thanks
I faced an another use case where I got the similar error.
When At first I got the error, I panicked, and removed /data/data/{package.name}
After that I tried, and my problem was still present.
Then I tried uninstall, it failed.
I then removed the apk file present in /system/app (required root access), and tried uninstall and it was successfull.
After that I tried re-installing the apk, it worked.
If you encounter a failed deployment to an Andorid device or emulator with the error "Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]" in the Output Window, simply delete the existing app on the device or emulator and redeploy. Debug builds will use a debug certificate while Release builds will use your configured certificate. This error is simply letting you know that the certificate of the app installed on the device is different than the one you are attempting to install. In non-development (app store) scenarios, this can be indicator of a corrupted or otherwise modified app not safe to install on the device.
I had the same problem until I realised I had the simulator running and adb was trying to install on that
For what it is worth, I ran into this problem after adding a new plugin to my Cordova project. I had been having cordova do builds and install directly on the device via USB.
I fixed it by uninstalling the app from the device and on the next deploy there were no problems.
Nothing from above worked for me. The problem for me was that I had wrong source in my Java Build Path for android-support-v7-appcompat. When you go to Project> Build Path> Configure Build Path>. Under the Source tab make sure you have android-support-v7-appcompat/gen , android-support-v7-appcompat/libs and android-support-v7-appcompat/src and nothing else. Click OK and it should work.
I've had the same error today, but the problem wasn’t exactly the same. I’m using ADB with Android installed in VirtualBox. I tried to install different versions of my app (signed / not signed, debug / release mode) and got two errors alternatively : INSTALL_FAILED_UID_CHANGED and INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES.
Now, when looking at /data/data/{package.name}, I found a bunch of files that were still there after uninstalling the app. I tried to rm -rf them without success : I got I/O errors.
The solution to this was :
Shut down the VM
Mount the VDI image with vdfuse (read/write)
Repair the Partition1 image file with e2fsck
Umount and restart the VM
Since the verification is based on package's name, you can change the package name inside your config.xml or manifest file for another name you want.
When publishing your app don't forget to change back the name!
I had this problem trying to execute gradle task connectedDebugAndoidTest (or connectedAndroidTest) on Genymotion. Running it on normal emulator solved the problem.
I think , your app installed by other account.( multiple account mode feature ) You can uninstall app in Setting>Apps>"app name"> Uninstall

Categories

Resources