I am building an App using jquerymobile and Phonegap. Phonegap should be adding the debug key for android build.
Can someone help me as to where I can find that key. I need the key to use with facebook App to connect with facebook.
All help appreciated
You can't use a debug key, but need to generate a release key and attach the keystore to build.phonegap.com build for android. Steps for getting the release key are here
http://developer.android.com/tools/publishing/app-signing.html
You need to generate new keystore. Use this command to generate it inside your terminal/CMD.
keytool -exportcert -alias YourAppName -keystore /Desktop/YourAppNameKeyStore | openssl sha1 -binary | openssl base64
Related
I'm having the problem "App is misconfigured" and I'm thinking the problem is the hash key.
I would to print for verify.
How can I show it in logcat without using Single Sign On but with LoginButton authentication?
Thanks.
I forgot to mention that I'm developing on Android.
perhaps you need to generate a hash key from your debug key store, and put it to your fb app config.
try to use the keytool:
keytool -exportcert -alias YOUR-ALIAS_HERE -keystore PATH_TO_YOUR_KEYSTORE -storepass KEYSTORE-PASSWORD -keypass KEY-PASSWORD | openssl sha1 -binary | openssl base64
for android debug keystore:
Alias: androiddebugkey
Both passwords: android
I finally solved!!! :D
I created a "test" project using SSO.
Linking old Facebook API it all works fine (using hash key generated with keytool) but, linking the new Facebook API 3.0.2 retrieve the error message "key mismatch".
Then, I copied the key show it in error message in dashboard and it all works!
I have a problem when I want to publish my android application with facebook integrated. I signed my app with eclipse, and used "keytool -exportcert -alias androidreleasekey -keystore MyReleaseKeystore.keystore | openssl sha1 -binary | openssl base64" in terminal to generate a release key, and I added in "Native Android App" configuration. If I try to log in fb via application I received dialog with nothing.
The path to keystore file is correct because keytool asked me for password.
I used the same keystore to sign apk in eclipse and to generate fb hash. Password is correct.
I copied generated hash to fb developer console.
When I tested with debugkey, all work fine. I had a problem with hash in debug mode but I could have turn on debugging in facebook sdk Util class and check in logcat the correct hash but in release apk this trick did not work (I could not see any error).
Could anyone help me?
Check your alias in "-alias androidreleasekey" is the same with the alias you generated in ReleaseKeyStore.keystore
i am using windows 7. trying to create new native android app.
to generate the key hash i wrote the following line in the cmd
C:\Program Files\Java\jre1.6.0_25\bin>keytool -exportcert -alias androiddebugkey
-keystore C:\Users\Youske.android\debug.keystore | C:\openssl\bin\openssl sha1
-binary | C:\openssl\bin\openssl base64
i enter the password : android
and i got my key hash : 0UzmruCvZLUgljxZvly3B34D7zA=
then i enable Configured for Android SSO: , then i copy this key to the "android key hash" texterea , click on save changes , and facebook generate to me the next error :
Error
You have enabled a Native Android App integration for your app, but have not specified the Android Key Hash. For security reasons, the Facebook application will not interact with any native application that does not have a signature that matches a corresponding key hash.
so if any one face this problem please help me.
I ran into this exact problem, and fixed it by simply using Firefox instead of Google Chrome. Hope this helps!
I download Hackbook example from git then, I create and run project. It show that Login failed: invalid_key(I didn't change anything) So, I try create my new own app and add Hash key that i got from keytool to facebook app setting (Android Native App) Then, I change this new Facebook("My_own_APP_ID"); It works!
The question:
Do I need to add new key hash every time I change development computer(In case, there are many collaborators, Do they need to change Facebook_APP_ID everytime ?
In case, I wanna launch this app to market. Do I need to change this keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64 when i ask for hash key ?
The answer based on my experience
Do I need to add new key hash every time I change development computer(In case, there are many collaborators, Do they need to change
Facebook_APP_ID everytime ?
You don't need to change Facebook_APP_ID everytime. Once you created facebook app, you can add multiple key hash to it. If you have many collaborators, get keyhash from them and add the keyhash to your facebook app.
In case, I wanna launch this app to market. Do I need to change this keytool -exportcert -alias androiddebugkey -keystore
~/.android/debug.keystore | openssl sha1 -binary | openssl base64 when
i ask for hash key ?
Yes. You replace ~/.android/debug.keystore with your own publishing keystore and again add that keyhash to facebook app.
Another alternative,
if you don't want to add a lot of keyhash to facebook app, you can always use one common debug key to sign your android app for all collaborators.
But of course, don't share your publishing key to everyone.
keytool -exportcert -alias mykeystore -keystore mykeystore| openssl sha1 -binary | openssl base64
hello, I am using the above command to generate my facebook key hash. It asks for my password and gives me a key hash. I put this key hash in the facebook app settings, yet it does not work for my signed android app.
When I was debugging the android app, I saw the console message saying it didn't recognize "android key hash blahblahblah" so I copied "blahblahblah" into the facebook app, and that worked - my android app was able to use the facebook stuff while in debug mode. But clearly that was only for the debug keystore. Now for the real keystore the one it generates is still wrong, so a production version of my app will not be able to use facebook api.
One thing about my keystore is that it was made in eclipse. It is one keystore with two keys in it. I have noticed that eclipse keystore acts different than command line keystore things, and that they are incompatible for signing things. Yet I have already released a version of my app so I need to make due with the keys I am already using.
Insight appreciated.
Use keytool -list to list the aliases you have. If you are not sure which one you used to sign the APK you released, try both. One should work.
I had this same problem - debug hash key worked but production key did not. I ended up installing OpenSSL from a different source than I originally installed, re-created the hash key, and it fixed the problem. This is the site where I got OpenSSL that worked: http://gnuwin32.sourceforge.net/packages/openssl.htm.
If running Cygwin on Windows, use cygpath to find the keystore:
keytool -exportcert -alias androiddebugkey -keystore $(cygpath -aw ~/.android/debug.keystore) | openssl sha1 -binary | openssl base64 Keystore-Kennwort eingeben: android
If using /cygpath/c/Users/name/... it will not work.