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

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...

Related

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.

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.

Unsigned Android apk file won't install

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.

Deploying Android App To Multiple Test Devices

I exported an unsigned apk file that represents a test version of my Android application. I need to distribute this to quite a few users. Is there a simple method to distribute the apk file where it will install the app? I'm trying to avoid the test users from having to download something like Astro or the sdk. Any ideas? I tried putting it out on a global web server and the file downloads but doesn't install. Thanks for the help!
From the android documentation:
The Android system will not install or run an application that is not
signed appropriately. This applies wherever the Android system is run,
whether on an actual device or on the emulator. For this reason, you
must set up signing for your application before you can run it or
debug it on an emulator or device.
So even if your users have the "Allow installing non-market apps" checked, your application will still have to be signed with at least a test key before it can be installed on a physical device.
I just put my experimental apps on the Android market with a description that says "don't install this, it won't work for you" and then give an access key to my testers.

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..

Categories

Resources