this is my first time of trying to sign a map and i get this error from my mac terminal saying alias <----->does not exist am trying to get my MD5 from my mac using the key tool. i have google for a while now, thank you , i will be here waiting for your response
Since you are using Eclipse, I suggest the following:
In Eclipse, go to Window -> Preferences.
Click on Android -> Build.
You will see an entry for Default debug keystore and the directory/file that it is currently present in.
That is file you need to be firing those keytool commands on. The -keystore parameter will point to the file you see in step 3 above.
Hope this helps.
It sounds like you have the alias wrong from eclipse, or actually if I had to guess, the file location wrong. I'd try making a new keystore and doing it again. Based on what you're saying the error is, I would be shocked if the problem was not in your alias/keystore setup being consistent with the command you are using. IE having the alias wrong, or improperly pointing at the keystore you created etc. Unfortunately, without more details on how exactly you setup your keystore and where you are running the command from etc, it is impossible to debug further from here. If you cannot fix it on your own, I'd suggest taking some screenshots of setting up the keystore and then write down the exact command you are using for the keytool and posting them.
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
I am trying to get a google API key to add google maps to my application. I have found a tutorial and created a keystore for my application in eclipse. I am having trouble figuring out how to get the fingerprint. I cannot seem to find the keytool in any of the directories to enter the command to get the fingerprint. I went to Library/Java/JavaVirtualMachine, but the directory after that is empty. Is there another file or a place where the keytool can be found in the directory? I have looked at several tutorials including the android one and have not had much luck. Any ideas>
keytool seems to be in your PATH variable -> so just type keytool inside your terminal and it should start.
$ whereis keytool
/usr/bin/keytool
I'm developing an app that uses Google Maps. I got the debug keystore and got the API key to work while I am debugging my program in Eclipse, but I am thoroughly confused in how to change this so that it works on an Android device when I export the .apk. I have searched around Google, but am mainly finding things that use the debug.keystore and I don't think this is what I want to use when I deploy this on an Android device, because I sent my .apk to a friend and he said he is getting gray boxes on the Map View.
Can anyone fill me in, step-by-step, on how to correctly make a new keystore for my app and how to sign my app so that it will work outside of debugging on Eclipse? A video tutorial would be preferable, but if not, simple 1-2-3 step type instructions would work. Thanks!
Eclipse (through ADT) has a nice wizard that lets you create a real keystore and build a signed apk. Right click your project, then Android Tools -> Export signed Application package
For the google maps key just follow these instructions
head to the command prompt, (I use windows so I'm going to go that route but same general idea for the other OS's)
The keytool program you'll need is part of the JDK so you do have it if your able to compile the apps at all. but it may not be on the app path so you can't just type it into the command line to be used.
for me it was in:C:\Program Files\Java\jdk1.7.0_21\bin so to get it on the app path I typed this in set PATH=%PATH%;C:\Program Files\Java\jdk1.7.0_21\bin
next you need to change to the directory your keystore files are in for me that is: C:\android\keys so I used the command cd C:\android\keys to change to the proper directory
then you need to run the keytool with the proper settings so it knows your after the key and not trying to do something else. the command I used was: keytool -list -v -keystore Testkeys and Testkeys is the name of my keystore use the name of your keystore there instead.
Last by not least it will spit out a whole bunch of different information but the one your looking for will look something like this
SHA1: A1:DF:83:DD:04:B2:26:10:B2:EB:26:00:90:75:D0:10:66:5E:A9:8A
you want all the numbers and : that are after the "SHA1: " that is your app key for the published version of your app, the one you need to register with the google maps api service, and then they will give you a new map api key that you need to put in your project and then republish it, and then the maps will work.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Login failed invalid key error with Facebook SDK
I am using a sample app for here ibm.com/developerworks/library/x-androidfacebookapi/
to test facebook android SDK,
I have given my APP ID in this sample app.
I have done all setups and prerequisites.
I have signed app with my keystore and generated hash key
I submitted hash key to facebook app settings page,
I installed facebook app on my device.
But after all doing the app gives Facebook error invalid_key.
Pls help me in this regards,
Thank you.
Invalid Key could be for a number of reasons -
Make sure you have Keytool and OpenSSL installed.
Make sure you are giving the correct Keystore file in the command.
Make sure you are giving the correct Alias.
Make sure you copied the generated Hash Key correctly to the Facebook application correctly.
When I got Invalid Key initially, it was because I was giving the wrong Alias. The strange thing is, that Keytool and OpenSSl won't mention that the alias is wrong. If you give the command to generate the Hash Key, and it doen't ask you for your password, you're probably doing it wrong.
After a few days of struggling with the same issues, I wrote up a full explanation of the problem and the various fixes here:
http://sean.lyn.ch/2011/07/android-the-facebook-sdk-sso-and-you/
A few things I ran into before I got this working:
1) Generate your hash in linux. Windows (at least for me, 64-bit) didn't generate the correct hash. Download the Cygwin bash shell and do it from there.
2) In the filepath for the keystore, everything should be a forward slash. Even in front of C:. So, for example, C:/Users/YourName/.android/debug.keystore, NOT C:\Users/YourName/.android/debug.keystore.
3) The equals at the end of the hash should be included. Maybe this was obvious to some people, but nevertheless I thought I should mention it.
It SHOULD prompt you for a password. If it doesn't, you've done something incorrectly.
I also had this problem, didn't really find how to resolve it untill I found this
http://support.getsocialize.com/socialize/topics/facebook_auth_key_issue_adding_the_invalid_key_from_logcat_seems_to_fix_sso?from_gsfn=truethread.
Every help topic states that the key hash hasn't been filled in correctly. After checking multiple times and using the keytool multiple times I knew I filled it in correctly. The above link goes to a toppic on Get Satisfaction about this issue, and the sollution that is offered there worked for me. Just copy the key you see in the popup into the hash box on your facebook developer page. It can be added alongside the hash you get from keytool.
Some things I found out while resolving this problem.
- I always used the full path in the keytool command
- when entering the keytool command make sure it asks for a password
- to find out if you correctly typed your password in de keytool command first supply it with something, that you know is not, your password cause it will also generate a hash. If the password is incorrect it will always give the same hash. so to check if you typed in your password correct compare it to a hash of a wrong password.
- This error only occurs if the facebook app is also on the phone, which I believe means that the error is not in the authentication itself, this made me search for errors in my code for hours while there were none (at least not in the authentication part :p)
- I was fortunate enough to have multiple test devices, which showed me it was not an error in the code but an error in the sdk or in some other part in the authentication phase.
I hope this info will help someone that runs into this problem and save him some time in resolving it.
kind regards Tom
Been having problems with this all day, I used cmd prompt to generate the key and it worked after I defined the path of openssl and keytool in the windows system settings.
I set up the Facebook application in eclipse and it was working fine on the AVD, however the same program causes the Facebook error invalid key when installed on my nexus s.
I've come to the conclusion that the device has its own keys and cannot use those in the keystore.
It is not logical bu "The Same" keytool command gives different results in Windows and Linux. The hash key got from Linux works, from Windows fails. You can try that!
The openssl in Windows installed from here: http://code.google.com/p/openssl-for-windows/
I have had the same problem and finally I found the solution : Use Cygwin for Windows users.
The result from Windows is different from linux/iOS.
So install Cygwin, it's very easy and you will also need cygwin if you want to work with NDK.
Run the command listed above copy the output and it will work.
Actually this is the problem in facebook sdk if you uninstall the com.facebook.katana then your application will work perfectly fine. I don't have a permanent solution for this problem but temporarily it will work
Today, you can't get a correct key with Windows EVEN using Cygwin. You must do it under MacOS or Linux. This is an issue. Hope they get it fixed very soon.
I was having this same problem and I think many others are running into the same thing that I was. The key store on windows is under the user directory by default e.g. C:\Users\User Name.android\
It failed for me because I was entering the full path and it had a space (" ") in folder that is named after the user. If you put quotes around the path it will likely work, and you should be prompted for the keystore password.
e.g.
keytool -exportcert -alias androiddebugkey -keystore "C:\Users\User Name.android" | openssl sha1 -binary | openssl base64
I'm using windows 7 and fix problem using :
keytool -export -alias androiddebugkey -keystore "[PATH]\debug.keystore" -storepass android -keypass android | openssl sha1 -binary | openssl enc -a -e
You can download OpenSSL for Windows
i fix the bug with this:
if you add to authorize line this code
Facebook.FORCE_DIALOG_AUTH
mFacebook.authorize(MundialRugby2011Activity.this,
new String[] {"publish_stream", "read_stream",
"offline_access"},Facebook.FORCE_DIALOG_AUTH, new LoginDialogListener());