Google sign in signed apk not working

前端 未结 7 2592
天涯浪人
天涯浪人 2020-11-29 09:12

Well all works till i generate the signed apk . I followed the entire process as told on the google developers page

1.I generated the google-services.json file with

相关标签:
7条回答
  • 2020-11-29 09:53

    FWIW:

    For me, I had the release and debug configuration (Oath client IDs, SHA-1, etc) all set up in the Google dev console and google-services.json file installed on the project.

    Because I'm working with multiple build flavors, I put the various config files in their respective ./app/<flavorN>/ directories.

    My fault was failing to generate the signed APK with the correct keystore file, alias & password in the Generate Signed APK wizard. The wizard was caching keys and credentials from a previous build flavor (tsk). But after reseting the keys to map to the target flavor, I now have a working Google Sign in.

    0 讨论(0)
  • 2020-11-29 09:58

    @-vj-@ ==> 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.

    ==> Displaying the debug certificate fingerprint

    Locate your debug keystore file. The file name is debug.keystore, and is created the first time you build your project. By default, it is stored in the same directory as your Android Virtual Device (AVD) files:

    macOS and Linux: ~/.android/ Windows Vista and Windows 7: C:\Users\your_user_name\.android\ List the SHA-1 fingerprint:

    For Linux or macOS, open a terminal window and enter the following:

    keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
    

    For Windows Vista and Windows 7, run:

    keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
    

    ==> Displaying the release certificate fingerprint

    Locate your release certificate keystore file. There is no default location or name for the release keystore. If you don't specify one when you build your app for release, the build will leave your .apk unsigned, and you'll have to sign it before you can publish it. For the release certificate, you also need the certificate's alias and the passwords for the keystore and the certificate. You can list the aliases for all the keys in a keystore by entering:

    keytool -list -keystore your_keystore_name
    

    Replace your_keystore_name with the fully-qualified path and name of the keystore, including the .keystore extension. You'll be prompted for the keystore's password. Then keytool displays all the aliases in the keystore. Enter the following at a terminal or command prompt:

    keytool -list -v -keystore your_keystore_name -alias your_alias_name
    

    Replace your_keystore_name with the fully-qualified path and name of the keystore, including the .keystore extension. Replace your_alias_name with the alias that you assigned to the certificate when you created it.

    0 讨论(0)
  • 2020-11-29 09:58

    If you have opted App Signing, you need to put the SHA1 generated from developer console

    For Firebase, put the same SHA1 in your Project Setting

    0 讨论(0)
  • 2020-11-29 10:00

    As I understand, you have provided the debug SHA1 in the developer console, then you signed the apk and the SHA1 changed. If this is the case try the following you should obtain the release SHA1 from the keystore and replace the old SHA with that.

    1. Open terminal and change the directory to JDK bin directory. Include your installed JDK version inside the path, for me it was - jdk1.8.0_101 (type javac -version to get the Java version) :

    Mac

        cd /Library/Java/JavaVirtualMachines/<your_JDK_version>.jdk/Contents/Home/bin
    

    Windows

        cd C:\Program Files\Java\your_JDK_version\bin 
    

    2. Use keytool to obtain the release SHA1 :

        keytool -list -v -keystore <keystore_name> -alias <alias_name>
    

    3. Go to your project's credentials page and replace the SHA1 to your keystore's release SHA1.

    0 讨论(0)
  • 2020-11-29 10:11

    You have to put two SHA-1 key in Firebase console Project->Setting->Android

    1 key: your key store's key i.e keytool -list -v -keystore -alias

    2 key: your play store's key i.e Release management->App signing->App signing Certificate->SHA 1 key fingerprint

    0 讨论(0)
  • 2020-11-29 10:13

    I had the same problem. I think I found out that Google doesn't allow you to have one certification for both the debug and the release apk of your app. You need to choose to either get the certificate only for one of them. Please correct me if I am wrong.

    What I did was to input the SHA1 fingerprint credentials for my release key and not my debug key on this link here

    Afterwards, my released apk worked and not my debug key.

    0 讨论(0)
提交回复
热议问题