I am developing an app where you are supposed to login with your Google account.
Last week I developed it on my Mac and it worked fine login in. Now I have changed to my desktop computer since I like it more. However, although I have updated the credentials with keytool -exportcert -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore and configured the project here it does not work.
I always get error code 10 and cannot login. Does anyone have a clue where to search for the error?
The error is on my device and the path and files should be correct. I have followed the instructions from Google to get the debug keys.
Can it be blocked for some reason since I have changed computer?
I "solved" it by starting a new project. Google requires a different key for different computers and it seems troublesome to just update the keys. Does anyone have a good idea of how to smoothly go between computers and only work on one project? Having two projects and a symbolic link to the source code?
Related
I'm new to developing Android apps and I wanted to create a Google map inside of a Fragment. So far I've gotten the part where I need the API key and I'm confused by the instructions from the Android developer site and everything I've found online hasn't cleared my confusion.
Could someone provide me with a step by step of how to get my SHA1 fingerprint on Windows 7?
You cannot obtain the API_KEY until you get your SHA1.
Click here to get a nice tutorial that will guide you step by step with images (Specifically when you are operating on Windows 7).
Hope this would Help!!
There are two kinds of fingerprints, debug and release. Assuming you want a release one, then from a console window, you need to run this command to get the fingerprint
keytool -exportcert -alias MY_RELEASE_KEY_ALIAS -keystore MY_FULL_PATH_TO_RELEASE_KEYSTORE_FILE -list -v
The keytool program is in your JDK bin folder. So on Windows, something like C:\Program Files\Java\jdk1.8.0_20\bin is where you should find keytool
Last thing to note is that MY_FULL_PATH_TO_RELEASE_KEYSTORE_FILE in the command above should be the full path to your .keystore file, including the file name
After all that, you will be finally be provided with several fingerprints, including the SHA1. You can copy that, and go back to Google Developers Console and paste it as a new line in the allowed Android Applications, with your package name added to the end, separated by a semi-colon.
I am having an issue with sharing on Facebook from my Unity app on android. It is really weird, the first time I built and ran the app on my device the facebook share pop up worked. Then I tried to build and run it again, this time from a different machine and it acts like it works but then it just flashes and the share popup never displays.
I have changed my Key Hash to match what is on the Facebook settings for my machine.
I can test it on the machine and use the token and it works fine.
My settings on face book then should be good I would think since it works from the computer, but what would cause it not to work from my device?
I hope someone can help, any suggestions are greatly appreciated!
The issue here was that in using the Key Hash that is output in the Unity UI does not work/is not correct. I had to generate the Hash using the java keytool in the cmd prompt or terminal.
IE:
keytool -exportcert -alias alias -keystore ~/user.keystore | openssl sha1 -binary | openssl base64
I am developing an app which requires google maps on android. Earlier I was developing on Windows and everything was working perfectly. A few days ago I switched to ubuntu and the maps suddenly stopped working. I have added the sha1 key to the console -
API key:
AIzaSyDD3ntjHTCKntDoVJt7J_eMZs-t7lYIlZ8
Android apps:
98:26:30:05:AF:D7:74:3F:5F:C1:BF:D6:24:80:5E:9B:DC:F4:F4:D6;com.opaxlabs.boatbrat EB:53:F8:2A:B3:05:63:5E:3F:CF:17:47:63:A8:8B:FA:C8:67:30:D4;com.opaxlabs.boatbrat
Activated on: Jun 25, 2014 5:07 AM
So that I have two sha1 fingerprints. I switched back to windows to check and the app was working perfectly there. The error in log cat states that -
Google Maps Android API(10773): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
The build when run on devices shows a blank screen where there should be a map.
The api key is mentioned in the manifest as -
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyDD3ntjHTCKntDoVJt7J_eMZs-t7lYIlZ8" />
Also in the emulator it asks me to update the api showing me a button to update which when clicked crashes the app. Please help me with your suggestions. Thanks in advance.
Edit:
The problem seems to be in the fact(Although I am not sure about it) that I had created a demo project on the google console and put the sha1 in it. Later I created a project and put a sha1 in that too. It seems that it was taking the key from the demo project and not the proper project. I have deleted the contents of the demo project but to no avail. Is there a way to correct this problem?
Open terminal
navigate to /usr/lib/jvm/java-1.7.0-openjdk-amd64/bin (bin of java )
write On terminal :- keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android
4.copy the SHA1 key and paste in place of the previous SHA1 of your windows
dont change anything else.
its working......
Seems like an issue with the api key.
Generate sha1 of the debug certificate on your ubuntu, and add it to the api console as another key in addition to the sha1 of certificate from windows.
That should solve the problem.
Regenerate sha on your pc,
Go to google console,
Create new Android key (for google map),(delete the old)
For Linux:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Copy sha with name of your project , for example: (Sha;projectname)
98:26:30:05:AF:D7:74:3F:5F:C1:BF:D6:24:80:5E:9B:DC:F4:F4:D6;com.example.androidapp
Copy API key to app.
In google console your Android apps have 2 times sha and project name.
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());
In November 2010 Facebook introduced Single-Sign-On for Android-Applications. Supposedly you can just login into your Facebook-App, and dont need to login again in your other applications, if you connect with Facebook-Login. However I experienced, that one of the Applications, either the Facebook-App, or my App fails with the login.
If the Facebook-App is installed, and I'm logged in, I cant log into my onw App, but instead get an error
"invalid_key"
If on the other hand, I first install my app, I'm logged into my App with Facebook-Login, and afterwards I install the Facebook App and try to logon their, the Facebook App fails and I cant login. Others seem to have the same issue: https://github.com/facebook/facebook-android-sdk/issues/closed#issue/140
Is there anybody out there you ran into the same issue and solved it?
This issue could be because of a number of reasons, most related to the wrong key-hash. I have answered a similar question here.
Are the set of permissions same in both the application?
This may or may not work for you, but OS X, Eclipse and running keytool -exportcert -alias androiddebugkey -keystore /Users/eosgood/.android/debug.keystore | openssl sha1 -binary | openssl base64 and Enter keystore password: 'android' worked for me. if the pass isnt android, it failed. Hopefully this helps, this problem is a tough one.
Thanks to facebook, now its giving key itself along with invalid_key exception.
Use that value and update in app settings. I am using windows 7 64 bit machine and for me the key doesn't have =(equal to) in the end but it worked cleanly.