3

On google play i tried creating a public key for google login keeping the fields for SHA1 key and package name empty to allow all android devices to have access to the api.But it shows "An internal error has occured" while trying to login.Then i tried creating another key with my compuer SHA1 key and my project's package name..then google login works fine for the build which i generated from my computer.But it doesn't work fine for the build which i generated from some other computer as that will have different SHA1 key.I want that my api key should have public access such that google login works fine from any computer from which i generate build.Is it possible?

Do i need to create both Client id and public api key access if i want everyone to be able to login?And should i provide my package name and SHA1 key while creating public api key access or should i leave it blank?

user3684678
  • 451
  • 3
  • 7
  • 20
  • Of course it is possible... you need to create a keystore with a key to sign your APK and use that SHA1 – Greg Ennis Feb 21 '15 at 04:04
  • @GregEnnis But that will sign the apk not my project..I want that on whichever computer i run my project it should be able to google login..and everytime i run project on different computer it will generate different apk..do i need to register all computer's SHA1 key? – user3684678 Feb 21 '15 at 04:19
  • You can use the same debug signing key on different computers to do what you want. The file name is debug.keystore and location varies based on OS but you can find it by name. – Greg Ennis Feb 21 '15 at 04:31
  • @GregEnnis I sent my entire project to my team member who is testing on different computer.The build which he generated from his computer is not able to google sign in but the build which i generated from my computer is able to sign in properly as my computer's SHA1 key is registered on developer console – user3684678 Feb 21 '15 at 04:35
  • @GregEnnis where do i need to add debug.keystore in my project? – user3684678 Feb 21 '15 at 04:37
  • Its not in your project directory. Its used for all projects! Try google searching for "where is debug.keystore" – Greg Ennis Feb 21 '15 at 12:50
  • But I repeat you should just be signing your APK with an explicit key that you CAN store in your project. Still don't understand why you refuse to do that. – Greg Ennis Feb 21 '15 at 12:52
  • @GregEnnis Regarding signing the apk shouldn't it be done only with the computer with which we are generating final apk for publishing in app store?Because my project involves team working on different computer and I am not the one who is going to publish the app.. – user3684678 Feb 21 '15 at 14:33
  • @GregEnnis As I told you I sent my entire project to my team member who is testing on different computer.The build which he generated from his computer is not able to google sign in but the build which i generated from my computer is able to sign in properly..This is because my SHA1 key is registered on developer console but not his..Can u please guide me with an answer the steps i need to follow so that he can also login with google usiing the build which he generated from my project on his computer? – user3684678 Feb 21 '15 at 14:40
  • Google search for "where is debug.keystore" send your keystore to others. – Greg Ennis Feb 21 '15 at 15:42
  • @GregEnnis Thanku for ur time..okay i got the keystore in android studio signing configuration..the store file there written is not present in my computer..it must be assigned by someone else in my team..everyone in the team must be using same keystore file..then y is google login only working with the build generated from my computer.?now what should i do? – user3684678 Feb 21 '15 at 16:16
  • Sorry, I don't know why.. Now that you have got that far, try adding another question on stack overflow – Greg Ennis Feb 21 '15 at 16:37
  • On google developer console if i create Client id through OAuth using SHA1 key and my project package name then i am able to login through google.But if i create public api key for Google login using SHA1 key and my project package name and delete the Client ID then when I login it shows toast message "An internal error has occured".Any idea why i am facing this problem..And do i need to create both Client id and public api key access if i want everyone to be able to login?And should i provide my package name and SHA1 key while creating public api key access or should i leave it blank? – user3684678 Feb 21 '15 at 17:14
  • @GregEnnis Check out this.. http://stackoverflow.com/questions/28649732/creating-google-public-api-access – user3684678 Feb 21 '15 at 18:40
  • http://stackoverflow.com/questions/28654887/google-login-an-internal-error-has-occured – user3684678 Feb 22 '15 at 07:48
  • @GregEnnis Thanku for ur time :) – user3684678 Feb 22 '15 at 15:59
  • have your solved your problem – N J May 11 '16 at 19:24
  • did you solved your problem? – Prathap Badavath Oct 17 '16 at 06:57

1 Answers1

0

The API key is based on a short form of your app's digital certificate, known as its SHA-1 fingerprint. To display the SHA-1 fingerprint for your certificate, first ensure that you are using the right certificate. You may have two certificates:

A debug certificate: The Android SDK tools generate this certificate automatically when you do a debug build. Only use this certificate with apps that you're testing. Do not attempt to publish an app that's signed with a debug certificate. The debug certificate is described in more detail in Signing in Debug Mode in the Android Developer Documentation.

A release certificate: The Android SDK tools generate this certificate when you do a release build. You can also generate this certificate using the keytool program. Use this certificate when you are ready to release your app to the world.

Google sign in signed apk not working