{"id":3051,"date":"2023-07-16T00:42:13","date_gmt":"2023-07-16T00:42:13","guid":{"rendered":"https:\/\/www.safewiper.com\/blog\/?p=3051"},"modified":"2023-07-16T00:42:13","modified_gmt":"2023-07-16T00:42:13","slug":"how-to-get-sha1-key-on-android-studio-for-firebase","status":"publish","type":"post","link":"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html","title":{"rendered":"How to Get Sha1 Key on Android Studio for Firebase?"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_45_1 counter-hierarchy ez-toc-counter ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" area-label=\"ez-toc-toggle-icon-1\"><label for=\"item-69e8b76e0c2dd\" aria-label=\"Table of Content\"><span style=\"display: flex;align-items: center;width: 35px;height: 30px;justify-content: center;direction:ltr;\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/label><input  type=\"checkbox\" id=\"item-69e8b76e0c2dd\"><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html\/#Video_Tutorial_How_to_get_SHA-1_key_in_Android_Studio\" title=\"Video Tutorial:How to get SHA-1 key in Android Studio?\">Video Tutorial:How to get SHA-1 key in Android Studio?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html\/#How_do_I_add_SHA-1_key_to_Firebase\" title=\"How do I add SHA-1 key to Firebase?\">How do I add SHA-1 key to Firebase?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html\/#How_to_add_sha_key_in_Firebase_Android\" title=\"How to add sha key in Firebase Android?\">How to add sha key in Firebase Android?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html\/#How_to_get_SHA-1_or_SHA_256_key_in_Android_Studio_for_Firebase_Flutter\" title=\"How to get SHA-1 or SHA 256 key in Android Studio for Firebase Flutter?\">How to get SHA-1 or SHA 256 key in Android Studio for Firebase Flutter?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html\/#How_to_get_SHA1_signing_certificate_for_Android\" title=\"How to get SHA1 signing certificate for Android?\">How to get SHA1 signing certificate for Android?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html\/#How_to_get_SHA1_key_in_Android_Studio_for_firebase_react_native\" title=\"How to get SHA1 key in Android Studio for firebase react native?\">How to get SHA1 key in Android Studio for firebase react native?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html\/#How_to_get_SHA-1_key_in_android_studio_for_Firebase_react_native\" title=\"How to get SHA-1 key in android studio for Firebase react native?\">How to get SHA-1 key in android studio for Firebase react native?<\/a><\/li><\/ul><\/nav><\/div>\n<p>Getting the SHA1 key on Android Studio for Firebase involves a few steps. Here&#8217;s how you can obtain it:<\/p>\n<p>1. Open your Android Studio project and ensure that you have integrated Firebase into your app. If you haven&#8217;t yet, you can follow the official Firebase documentation to set it up.<\/p>\n<p>2. Once Firebase is integrated, locate the &#8220;Gradle&#8221; tab on the right side of your Android Studio interface. It usually appears on the right-hand side.<\/p>\n<p>3. Expand the project directory structure until you find the module-level &#8220;build.gradle&#8221; file. It is typically located under &#8220;app&#8221; or &#8220;mobile.&#8221;<\/p>\n<p>4. Click on the &#8220;build.gradle&#8221; file, and it will open in the editor. Look for the &#8220;signingConfigs&#8221; block within the file. If it doesn&#8217;t exist, you can add it as follows:<\/p>\n<p>&#8220;`gradle<br \/>\nandroid {<br \/>\n    \/\/&#8230;<br \/>\n    signingConfigs {<br \/>\n        debug {<br \/>\n            \/\/ Configure the signing details for your debug build<br \/>\n        }<br \/>\n    }<br \/>\n    \/\/&#8230;<br \/>\n}<br \/>\n&#8220;`<\/p>\n<p>5. Inside the &#8220;debug&#8221; block, add the following code to generate the SHA1 key:<\/p>\n<p>&#8220;`gradle<br \/>\nsigningConfigs {<br \/>\n    debug {<br \/>\n        \/\/ Configure the signing details for your debug build<\/p>\n<p>        \/\/ Add the following lines:<br \/>\n        try {<br \/>\n            def keystorePropertiesFile = rootProject.file(&#8220;keystore.properties&#8221;)<br \/>\n            def keystoreProperties = new Properties()<br \/>\n            keystoreProperties.load(new FileInputStream(keystorePropertiesFile))<\/p>\n<p>            signingConfig signingConfig androidSignings.skip<br \/>\n            \/\/ Replace &#8220;your_keystore_password&#8221; and &#8220;your_key_password&#8221; with the actual passwords from your keystore.properties file<br \/>\n            storeFile file(keystoreProperties[&#8216;storeFile&#8217;])<br \/>\n            storePassword keystoreProperties[&#8216;storePassword&#8217;]<br \/>\n            keyAlias keystoreProperties[&#8216;keyAlias&#8217;]<br \/>\n            keyPassword keystoreProperties[&#8216;keyPassword&#8217;]<br \/>\n        } catch (FileNotFoundException ex) {<br \/>\n            throw new InvalidUserDataException(&#8220;Unable to find keystore.properties file. Make sure it is present in the root project directory.&#8221;)<br \/>\n        } catch (IOException ex) {<br \/>\n            throw new InvalidUserDataException(&#8220;Unable to load keystore.properties file.&#8221;)<br \/>\n        }<br \/>\n    }<br \/>\n}<br \/>\n&#8220;`<\/p>\n<p>6. Save the changes you made to the &#8220;build.gradle&#8221; file.<\/p>\n<p>7. Next, you need to create a &#8220;keystore.properties&#8221; file in the root directory of your project. The file should contain the following information:<\/p>\n<p>&#8220;`<br \/>\nstoreFile=path_to_your_keystore_file<br \/>\nstorePassword=your_keystore_password<br \/>\nkeyAlias=your_key_alias<br \/>\nkeyPassword=your_key_password<br \/>\n&#8220;`<\/p>\n<p>Replace the placeholders with the actual paths and passwords relevant to your keystore file.<\/p>\n<p>8. After creating the &#8220;keystore.properties&#8221; file, navigate to the &#8220;Gradle&#8221; tab again and expand your project directory structure.<\/p>\n<p>9. Expand the &#8220;Tasks&#8221; directory, then double-click on &#8220;android&#8221; and select &#8220;signingReport.&#8221; This will run the signingReport task, and you&#8217;ll see the SHA1 key in the &#8220;Run&#8221; tab of your Android Studio.<\/p>\n<p>10. Copy the SHA1 key and use it for the Firebase configuration, such as adding it to the Firebase project settings or enabling specific Firebase services that require it.<\/p>\n<p>That&#8217;s it! You have now obtained the SHA1 key for your Android Studio project to be used with Firebase. Remember to keep the key secure and update it in Firebase if necessary.<\/p>\n<p>(Please note that the instructions provided are based on the current knowledge, and there might be slight variations or updates in the future. It is always recommended to refer to the official documentation or resources for the most up-to-date information.)<\/p>\n<lite-youtube videoid=\"dwmMTsHFkbc\" playlabel=\"Play: Keynote (Google I\/O '18)\"><\/lite-youtube>\n<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Video_Tutorial_How_to_get_SHA-1_key_in_Android_Studio\"><\/span>Video Tutorial:How to get SHA-1 key in Android Studio?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<lite-youtube videoid=\"ojg2blTJTns\" playlabel=\"Play: Keynote (Google I\/O '18)\"><\/lite-youtube>\n<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_do_I_add_SHA-1_key_to_Firebase\"><\/span>How do I add SHA-1 key to Firebase?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To add a SHA-1 key to your Firebase project, follow these steps:<\/p>\n<p>1. Go to the Firebase console (console.firebase.google.com) and select your project.<\/p>\n<p>2. In the left-hand menu, click on the gear icon to open Project Settings.<\/p>\n<p>3. Under the Your apps section, you&#8217;ll see the app for which you want to add the SHA-1 key. If you haven&#8217;t added your app to Firebase yet, click on the Add app button and follow the instructions to set it up.<\/p>\n<p>4. Once you have selected your app, scroll down to the SHA certificate fingerprints section.<\/p>\n<p>5. To add a SHA-1 key, click on the Add fingerprint button.<\/p>\n<p>6. A dialog box will appear asking for the SHA-1 key. <\/p>\n<p>7. Open a command prompt or terminal, and navigate to the Java JDK installation directory (e.g., C:\\Program Files\\Java\\jdk1.8.0_221\\bin).<\/p>\n<p>8. Run the following command to generate the SHA-1 key:<br \/>\n   &#8220;`<br \/>\n   keytool -list -v -keystore &#8220;C:\\Path\\to\\your\\keystore.jks&#8221; -alias &#8220;your alias name&#8221;<br \/>\n   &#8220;`<\/p>\n<p>   Replace &#8220;C:\\Path\\to\\your\\keystore.jks&#8221; with the path to your keystore file, and &#8220;your alias name&#8221; with the alias name you used when creating the keystore.<\/p>\n<p>9. Copy the SHA-1 key from the output and paste it into the dialog box in the Firebase console.<\/p>\n<p>10. Click on the Save button to add the SHA-1 key to your Firebase project.<\/p>\n<p>By adding the SHA-1 key, you enable Firebase services, such as Authentication and Cloud Messaging, to authenticate requests coming from your Android app. Make sure to update your app with the new Firebase configuration files (e.g., google-services.json) that include the added SHA-1 key for proper integration.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_add_sha_key_in_Firebase_Android\"><\/span>How to add sha key in Firebase Android?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To add a SHA key in Firebase for Android, you would follow these steps:<\/p>\n<p>1. Open your Firebase project in the Firebase console.<br \/>\n2. Go to the project settings by clicking on the gear icon next to the project name in the top-left corner.<br \/>\n3. Navigate to the &#8220;General&#8221; tab and scroll down to the section titled &#8220;Your apps.&#8221;<br \/>\n4. Select your Android app by clicking on its package name.<br \/>\n5. In the &#8220;Your apps&#8221; page, locate and click on the &#8220;SHA certificate fingerprints&#8221; under the &#8220;Your apps&#8221; section.<br \/>\n6. Click on the &#8220;Add fingerprint&#8221; button.<br \/>\n7. In the dialog that opens, enter the SHA-1 or SHA-256 fingerprint for your Android app. Make sure to choose the correct one depending on your application&#8217;s needs.<br \/>\n    &#8211; To obtain the SHA key, open your Android Studio project.<br \/>\n    &#8211; Navigate to the Gradle tab on the right side of the window.<br \/>\n    &#8211; Expand the project name, then open the app folder, and then open the &#8220;Tasks&#8221; folder.<br \/>\n    &#8211; Double-click on the &#8220;android&#8221; task, which will open a terminal at the bottom of the screen.<br \/>\n    &#8211; Type the command `.\/gradlew signingReport` and hit Enter.<br \/>\n    &#8211; After running the command, you will find the SHA keys in the terminal next to &#8220;SHA1:&#8221; and &#8220;SHA-256:&#8221; for your debug and release keystores.<br \/>\n8. After entering the correct SHA key, click on the &#8220;Save&#8221; button.<br \/>\n9. Once the fingerprint is added, you can download the updated google-services.json file for your Android app by clicking on the &#8220;Download google-services.json&#8221; button on the &#8220;Your apps&#8221; page.<br \/>\n10. Finally, move the downloaded google-services.json file to the app folder of your Android project.<\/p>\n<p>By following these steps, you will successfully add the SHA key in Firebase for your Android app, allowing you to integrate Firebase services into your application.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_get_SHA-1_or_SHA_256_key_in_Android_Studio_for_Firebase_Flutter\"><\/span>How to get SHA-1 or SHA 256 key in Android Studio for Firebase Flutter?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To obtain the SHA-1 or SHA-256 key in Android Studio for Firebase Flutter, you can follow these steps:<\/p>\n<p>1. Open your Flutter project in Android Studio.<br \/>\n2. Ensure that you have integrated Firebase into your project by following the necessary steps provided by Firebase.<br \/>\n3. In Android Studio, locate the &#8220;Terminal&#8221; tab at the bottom of the IDE window.<br \/>\n4. Click on the Terminal tab to open a command prompt.<br \/>\n5. In the command prompt, type the following command:<br \/>\n   &#8211; For SHA-1 key: `keytool -list -v -keystore ~\/.android\/debug.keystore -alias androiddebugkey -storepass android -keypass android`<br \/>\n   &#8211; For SHA-256 key: `keytool -list -v -keystore ~\/.android\/debug.keystore -alias androiddebugkey -storepass android -keypass android | grep &#8220;SHA256:&#8221;<\/p>\n<p>6. Once you&#8217;ve entered the appropriate command, hit the Enter key.<br \/>\n7. Android Studio will generate the required key and display it in the Terminal.<br \/>\n8. Look for the generated key, which will be a combination of letters and numbers after the &#8220;SHA1: &#8221; or &#8220;SHA256: &#8221; prefix.<br \/>\n9. Copy the entire key, excluding whitespace or additional characters.<br \/>\n10. Use the copied key for the required configuration in your Firebase project.<\/p>\n<p>Remember, these steps assume you are using the debug.keystore, which is used when running your app in debug mode. If you need the key for a release build, the process is different and involves generating a keystore file.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_get_SHA1_signing_certificate_for_Android\"><\/span>How to get SHA1 signing certificate for Android?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To obtain the SHA1 signing certificate for Android, you can follow these steps:<\/p>\n<p>1. Open the terminal or command prompt on your computer.<br \/>\n2. Navigate to the JDK bin directory. This is typically located at &#8220;C:\\Program Files\\Java\\jdk<version>\\bin&#8221; on Windows or &#8220;\/Library\/Java\/JavaVirtualMachines\/jdk<version>.jdk\/Contents\/Home\/bin&#8221; on macOS.<br \/>\n3. Execute the following command to generate the SHA1 fingerprint:<br \/>\n   &#8220;`bash<br \/>\n   keytool -list -v -keystore <path-to-debug-or-production-keystore> -alias <a target=\"_blank\"lias-name> -storepass <keystore-password> -keypass <key-password><br \/>\n   &#8220;`<br \/>\n   Replace `<path-to-debug-or-production-keystore>` with the path to your debug.keystore (used for development) or your production keystore (used for releasing apps). Also, replace `<a target=\"_blank\"lias-name>` with the alias defined during the key creation, `<keystore-password>` with the password for the keystore, and `<key-password>` with the password for the key.<\/p>\n<p>   For debug.keystore, its default location is &#8220;~\/.android\/debug.keystore&#8221; on macOS and Linux, &#8220;C:\\Users\\<username>\\.android\\debug.keystore&#8221; on Windows.<br \/>\n4. Press Enter and wait for the command to execute. The output will contain multiple certificate fingerprints, including the SHA1 fingerprint. Look for the line starting with &#8220;SHA1:&#8221; to find the desired certificate.<\/p>\n<p>By following these steps, you will be able to obtain the SHA1 signing certificate for your Android app.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_get_SHA1_key_in_Android_Studio_for_firebase_react_native\"><\/span>How to get SHA1 key in Android Studio for firebase react native?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To obtain the SHA1 key in Android Studio for Firebase in a React Native project, follow these steps:<\/p>\n<p>1. Open your React Native project in Android Studio.<br \/>\n2. Go to the Android module of your project by navigating to the &#8220;android&#8221; folder within your project directory.<br \/>\n3. In Android Studio, make sure the &#8220;Project&#8221; view is selected in the left pane.<br \/>\n4. Locate the &#8220;Gradle Scripts&#8221; section and expand it. Then, double-click on the &#8220;android&#8221; folder to reveal its contents.<br \/>\n5. Expand the &#8220;app&#8221; folder, then the &#8220;src&#8221; folder, and finally the &#8220;main&#8221; folder.<br \/>\n6. Look for a file named &#8220;MainActivity.java&#8221; within this folder structure and double-click to open it in the editor.<br \/>\n7. Look for the `protected List<ReactPackage> getPackages()` method within the file. This method returns a list of React Native packages used in your project.<br \/>\n8. Add the following import statement at the top of the file if it doesn&#8217;t already exist:<\/p>\n<p>&#8220;`java<br \/>\nimport android.content.pm.PackageInfo;<br \/>\nimport android.content.pm.PackageManager;<br \/>\nimport android.content.pm.Signature;<br \/>\nimport android.util.Base64;<br \/>\nimport java.security.MessageDigest;<br \/>\nimport java.security.NoSuchAlgorithmException;<br \/>\nimport java.util.ArrayList;<br \/>\nimport java.util.List;<br \/>\n&#8220;`<\/p>\n<p>9. Inside the `getPackages()` method, after declaring the `packages` variable, add the following code:<\/p>\n<p>&#8220;`java<br \/>\ntry {<br \/>\n    PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);<br \/>\n    for (Signature signature : packageInfo.signatures) {<br \/>\n        MessageDigest md = MessageDigest.getInstance(&#8220;SHA&#8221;);<br \/>\n        md.update(signature.toByteArray());<br \/>\n        String sha1Key = Base64.encodeToString(md.digest(), Base64.NO_WRAP);<br \/>\n        Log.d(&#8220;SHA1 Key&#8221;, sha1Key);<br \/>\n    }<br \/>\n} catch (PackageManager.NameNotFoundException e) {<br \/>\n    e.printStackTrace();<br \/>\n} catch (NoSuchAlgorithmException e) {<br \/>\n    e.printStackTrace();<br \/>\n}<br \/>\n&#8220;`<\/p>\n<p>10. Save the file and run your React Native application on an Android device or emulator from within Android Studio.<br \/>\n11. After your app launches, open the Logcat console in Android Studio. You should see a message containing the SHA1 key printed in the console.<\/p>\n<p>Make sure to copy the printed SHA1 key exactly as shown and use it in your Firebase project settings. This key is required for various Firebase services, such as authentication and cloud messaging, to work properly in your React Native app.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_get_SHA-1_key_in_android_studio_for_Firebase_react_native\"><\/span>How to get SHA-1 key in android studio for Firebase react native?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To obtain the SHA-1 key in Android Studio for Firebase React Native, you can follow these steps:<\/p>\n<p>1. Open your project in Android Studio.<br \/>\n2. In the toolbar, go to &#8220;Gradle&#8221; and expand your project.<br \/>\n3. Expand the &#8220;android&#8221; folder, and then locate and double-click on the &#8220;app&#8221; folder.<br \/>\n4. Inside the &#8220;app&#8221; folder, find and double-click on the &#8220;Tasks&#8221; folder.<br \/>\n5. Next, double-click on the &#8220;android&#8221; folder within the &#8220;Tasks&#8221; folder.<br \/>\n6. From the options displayed, double-click on &#8220;signingReport&#8221;. This will trigger the execution of Gradle&#8217;s signing report task.<br \/>\n7. Gradle will generate a report in the &#8220;Run&#8221; tab, which will provide you with the SHA-1 key. Look for the &#8220;SHA1&#8221; label to find your key.<\/p>\n<p>Once you have obtained the SHA-1 key, you can go to the Firebase Console and add it to your project&#8217;s settings for authentication, push notifications, and other necessary Firebase features.<\/p>\n<p>Please note that the steps provided above are specific to Android Studio and may vary slightly depending on the version you are using. Additionally, make sure you have the necessary dependencies and configurations properly set up in your project.<br \/>\n<script type=\"application\/ld+json\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@type\":\"FAQPage\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"How do I add SHA-1 key to Firebase?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"To add a SHA-1 key to your Firebase project, follow these steps:\\n\\n1. Go to the Firebase console (console.firebase.google.com) and select your project.\\n\\n2. In the left-hand menu, click on the gear icon to open Project Settings.\\n\\n3. Under the Your apps section, you'll see the app for which you want to add the SHA-1 key. If you haven't added your app to Firebase yet, click on the Add app button and follow the instructions to set it up.\\n\\n4. Once you have selected your app, scroll down to the SHA certificate fingerprints section.\\n\\n5. To add a SHA-1 key, click on the Add fingerprint button.\\n\\n6. A dialog box will appear asking for the SHA-1 key. \\n\\n7. Open a command prompt or terminal, and navigate to the Java JDK installation directory (e.g., C:\\\\Program Files\\\\Java\\\\jdk1.8.0_221\\\\bin).\\n\\n8. Run the following command to generate the SHA-1 key:\\n   ```\\n   keytool -list -v -keystore \\\"C:\\\\Path\\\\to\\\\your\\\\keystore.jks\\\" -alias \\\"your alias name\\\"\\n   ```\\n\\n   Replace \\\"C:\\\\Path\\\\to\\\\your\\\\keystore.jks\\\" with the path to your keystore file, and \\\"your alias name\\\" with the alias name you used when creating the keystore.\\n\\n9. Copy the SHA-1 key from the output and paste it into the dialog box in the Firebase console.\\n\\n10. Click on the Save button to add the SHA-1 key to your Firebase project.\\n\\nBy adding the SHA-1 key, you enable Firebase services, such as Authentication and Cloud Messaging, to authenticate requests coming from your Android app. Make sure to update your app with the new Firebase configuration files (e.g., google-services.json) that include the added SHA-1 key for proper integration.\"}},{\"@type\":\"Question\",\"name\":\"How to add sha key in Firebase Android?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"To add a SHA key in Firebase for Android, you would follow these steps:\\n\\n1. Open your Firebase project in the Firebase console.\\n2. Go to the project settings by clicking on the gear icon next to the project name in the top-left corner.\\n3. Navigate to the \\\"General\\\" tab and scroll down to the section titled \\\"Your apps.\\\"\\n4. Select your Android app by clicking on its package name.\\n5. In the \\\"Your apps\\\" page, locate and click on the \\\"SHA certificate fingerprints\\\" under the \\\"Your apps\\\" section.\\n6. Click on the \\\"Add fingerprint\\\" button.\\n7. In the dialog that opens, enter the SHA-1 or SHA-256 fingerprint for your Android app. Make sure to choose the correct one depending on your application's needs.\\n    - To obtain the SHA key, open your Android Studio project.\\n    - Navigate to the Gradle tab on the right side of the window.\\n    - Expand the project name, then open the app folder, and then open the \\\"Tasks\\\" folder.\\n    - Double-click on the \\\"android\\\" task, which will open a terminal at the bottom of the screen.\\n    - Type the command `.\\\/gradlew signingReport` and hit Enter.\\n    - After running the command, you will find the SHA keys in the terminal next to \\\"SHA1:\\\" and \\\"SHA-256:\\\" for your debug and release keystores.\\n8. After entering the correct SHA key, click on the \\\"Save\\\" button.\\n9. Once the fingerprint is added, you can download the updated google-services.json file for your Android app by clicking on the \\\"Download google-services.json\\\" button on the \\\"Your apps\\\" page.\\n10. Finally, move the downloaded google-services.json file to the app folder of your Android project.\\n\\nBy following these steps, you will successfully add the SHA key in Firebase for your Android app, allowing you to integrate Firebase services into your application.\"}},{\"@type\":\"Question\",\"name\":\"How to get SHA-1 or SHA 256 key in Android Studio for Firebase Flutter?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"To obtain the SHA-1 or SHA-256 key in Android Studio for Firebase Flutter, you can follow these steps:\\n\\n1. Open your Flutter project in Android Studio.\\n2. Ensure that you have integrated Firebase into your project by following the necessary steps provided by Firebase.\\n3. In Android Studio, locate the \\\"Terminal\\\" tab at the bottom of the IDE window.\\n4. Click on the Terminal tab to open a command prompt.\\n5. In the command prompt, type the following command:\\n   - For SHA-1 key: `keytool -list -v -keystore ~\\\/.android\\\/debug.keystore -alias androiddebugkey -storepass android -keypass android`\\n   - For SHA-256 key: `keytool -list -v -keystore ~\\\/.android\\\/debug.keystore -alias androiddebugkey -storepass android -keypass android | grep \\\"SHA256:\\\"\\n\\n6. Once you've entered the appropriate command, hit the Enter key.\\n7. Android Studio will generate the required key and display it in the Terminal.\\n8. Look for the generated key, which will be a combination of letters and numbers after the \\\"SHA1: \\\" or \\\"SHA256: \\\" prefix.\\n9. Copy the entire key, excluding whitespace or additional characters.\\n10. Use the copied key for the required configuration in your Firebase project.\\n\\nRemember, these steps assume you are using the debug.keystore, which is used when running your app in debug mode. If you need the key for a release build, the process is different and involves generating a keystore file.\"}},{\"@type\":\"Question\",\"name\":\"How to get SHA1 signing certificate for Android?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"To obtain the SHA1 signing certificate for Android, you can follow these steps:\\n\\n1. Open the terminal or command prompt on your computer.\\n2. Navigate to the JDK bin directory. This is typically located at \\\"C:\\\\Program Files\\\\Java\\\\jdk<version>\\\\bin\\\" on Windows or \\\"\\\/Library\\\/Java\\\/JavaVirtualMachines\\\/jdk<version>.jdk\\\/Contents\\\/Home\\\/bin\\\" on macOS.\\n3. Execute the following command to generate the SHA1 fingerprint:\\n   ```bash\\n   keytool -list -v -keystore <path-to-debug-or-production-keystore> -alias <a target=\"_blank\"lias-name> -storepass <keystore-password> -keypass <key-password>\\n   ```\\n   Replace `<path-to-debug-or-production-keystore>` with the path to your debug.keystore (used for development) or your production keystore (used for releasing apps). Also, replace `<a target=\"_blank\"lias-name>` with the alias defined during the key creation, `<keystore-password>` with the password for the keystore, and `<key-password>` with the password for the key.\\n   \\n   For debug.keystore, its default location is \\\"~\\\/.android\\\/debug.keystore\\\" on macOS and Linux, \\\"C:\\\\Users\\\\<username>\\\\.android\\\\debug.keystore\\\" on Windows.\\n4. Press Enter and wait for the command to execute. The output will contain multiple certificate fingerprints, including the SHA1 fingerprint. Look for the line starting with \\\"SHA1:\\\" to find the desired certificate.\\n\\nBy following these steps, you will be able to obtain the SHA1 signing certificate for your Android app.\"}},{\"@type\":\"Question\",\"name\":\"How to get SHA1 key in Android Studio for firebase react native?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"To obtain the SHA1 key in Android Studio for Firebase in a React Native project, follow these steps:\\n\\n1. Open your React Native project in Android Studio.\\n2. Go to the Android module of your project by navigating to the \\\"android\\\" folder within your project directory.\\n3. In Android Studio, make sure the \\\"Project\\\" view is selected in the left pane.\\n4. Locate the \\\"Gradle Scripts\\\" section and expand it. Then, double-click on the \\\"android\\\" folder to reveal its contents.\\n5. Expand the \\\"app\\\" folder, then the \\\"src\\\" folder, and finally the \\\"main\\\" folder.\\n6. Look for a file named \\\"MainActivity.java\\\" within this folder structure and double-click to open it in the editor.\\n7. Look for the `protected List<ReactPackage> getPackages()` method within the file. This method returns a list of React Native packages used in your project.\\n8. Add the following import statement at the top of the file if it doesn't already exist:\\n\\n```java\\nimport android.content.pm.PackageInfo;\\nimport android.content.pm.PackageManager;\\nimport android.content.pm.Signature;\\nimport android.util.Base64;\\nimport java.security.MessageDigest;\\nimport java.security.NoSuchAlgorithmException;\\nimport java.util.ArrayList;\\nimport java.util.List;\\n```\\n\\n9. Inside the `getPackages()` method, after declaring the `packages` variable, add the following code:\\n\\n```java\\ntry {\\n    PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);\\n    for (Signature signature : packageInfo.signatures) {\\n        MessageDigest md = MessageDigest.getInstance(\\\"SHA\\\");\\n        md.update(signature.toByteArray());\\n        String sha1Key = Base64.encodeToString(md.digest(), Base64.NO_WRAP);\\n        Log.d(\\\"SHA1 Key\\\", sha1Key);\\n    }\\n} catch (PackageManager.NameNotFoundException e) {\\n    e.printStackTrace();\\n} catch (NoSuchAlgorithmException e) {\\n    e.printStackTrace();\\n}\\n```\\n\\n10. Save the file and run your React Native application on an Android device or emulator from within Android Studio.\\n11. After your app launches, open the Logcat console in Android Studio. You should see a message containing the SHA1 key printed in the console.\\n\\nMake sure to copy the printed SHA1 key exactly as shown and use it in your Firebase project settings. This key is required for various Firebase services, such as authentication and cloud messaging, to work properly in your React Native app.\"}},{\"@type\":\"Question\",\"name\":\"How to get SHA-1 key in android studio for Firebase react native?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"To obtain the SHA-1 key in Android Studio for Firebase React Native, you can follow these steps:\\n\\n1. Open your project in Android Studio.\\n2. In the toolbar, go to \\\"Gradle\\\" and expand your project.\\n3. Expand the \\\"android\\\" folder, and then locate and double-click on the \\\"app\\\" folder.\\n4. Inside the \\\"app\\\" folder, find and double-click on the \\\"Tasks\\\" folder.\\n5. Next, double-click on the \\\"android\\\" folder within the \\\"Tasks\\\" folder.\\n6. From the options displayed, double-click on \\\"signingReport\\\". This will trigger the execution of Gradle's signing report task.\\n7. Gradle will generate a report in the \\\"Run\\\" tab, which will provide you with the SHA-1 key. Look for the \\\"SHA1\\\" label to find your key.\\n\\nOnce you have obtained the SHA-1 key, you can go to the Firebase Console and add it to your project's settings for authentication, push notifications, and other necessary Firebase features.\\n\\nPlease note that the steps provided above are specific to Android Studio and may vary slightly depending on the version you are using. Additionally, make sure you have the necessary dependencies and configurations properly set up in your project.\"}}]}<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Getting the SHA1 key on Android Studio for Firebase involves a few steps. Here&#8217;s how you can obtain it: 1. Open your Android Studio project and ensure that you have integrated Firebase into your app. If you haven&#8217;t yet, you can follow the official Firebase documentation to set it up. 2. Once Firebase is integrated, &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html\"> <span class=\"screen-reader-text\">How to Get Sha1 Key on Android Studio for Firebase?<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[3],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Get Sha1 Key On Android Studio For Firebase?<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Get Sha1 Key on Android Studio for Firebase?\" \/>\n<meta property=\"og:description\" content=\"Getting the SHA1 key on Android Studio for Firebase involves a few steps. Here&#8217;s how you can obtain it: 1. Open your Android Studio project and ensure that you have integrated Firebase into your app. If you haven&#8217;t yet, you can follow the official Firebase documentation to set it up. 2. Once Firebase is integrated, &hellip; How to Get Sha1 Key on Android Studio for Firebase? Read More &raquo;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-16T00:42:13+00:00\" \/>\n<meta name=\"author\" content=\"Day Geoffrey\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Day Geoffrey\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html\",\"url\":\"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html\",\"name\":\"How to Get Sha1 Key on Android Studio for Firebase?\",\"isPartOf\":{\"@id\":\"https:\/\/www.safewiper.com\/blog\/#website\"},\"datePublished\":\"2023-07-16T00:42:13+00:00\",\"dateModified\":\"2023-07-16T00:42:13+00:00\",\"author\":{\"@id\":\"https:\/\/www.safewiper.com\/blog\/#\/schema\/person\/06f7f520a585870db54b1422dd54cd43\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.safewiper.com\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Get Sha1 Key on Android Studio for Firebase?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.safewiper.com\/blog\/#website\",\"url\":\"https:\/\/www.safewiper.com\/blog\/\",\"name\":\"\",\"description\":\"Share the most comprehensive deletion solution about Android\/iPhone\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.safewiper.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.safewiper.com\/blog\/#\/schema\/person\/06f7f520a585870db54b1422dd54cd43\",\"name\":\"Day Geoffrey\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.safewiper.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/015c8189f7189137cd7f52c7deada4c4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/015c8189f7189137cd7f52c7deada4c4?s=96&d=mm&r=g\",\"caption\":\"Day Geoffrey\"},\"url\":\"https:\/\/www.safewiper.com\/blog\/author\/geoffrey\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Get Sha1 Key On Android Studio For Firebase?","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html","og_locale":"en_US","og_type":"article","og_title":"How to Get Sha1 Key on Android Studio for Firebase?","og_description":"Getting the SHA1 key on Android Studio for Firebase involves a few steps. Here&#8217;s how you can obtain it: 1. Open your Android Studio project and ensure that you have integrated Firebase into your app. If you haven&#8217;t yet, you can follow the official Firebase documentation to set it up. 2. Once Firebase is integrated, &hellip; How to Get Sha1 Key on Android Studio for Firebase? Read More &raquo;","og_url":"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html","article_published_time":"2023-07-16T00:42:13+00:00","author":"Day Geoffrey","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Day Geoffrey","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html","url":"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html","name":"How to Get Sha1 Key on Android Studio for Firebase?","isPartOf":{"@id":"https:\/\/www.safewiper.com\/blog\/#website"},"datePublished":"2023-07-16T00:42:13+00:00","dateModified":"2023-07-16T00:42:13+00:00","author":{"@id":"https:\/\/www.safewiper.com\/blog\/#\/schema\/person\/06f7f520a585870db54b1422dd54cd43"},"breadcrumb":{"@id":"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.safewiper.com\/blog\/how-to-get-sha1-key-on-android-studio-for-firebase.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.safewiper.com\/blog"},{"@type":"ListItem","position":2,"name":"How to Get Sha1 Key on Android Studio for Firebase?"}]},{"@type":"WebSite","@id":"https:\/\/www.safewiper.com\/blog\/#website","url":"https:\/\/www.safewiper.com\/blog\/","name":"","description":"Share the most comprehensive deletion solution about Android\/iPhone","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.safewiper.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.safewiper.com\/blog\/#\/schema\/person\/06f7f520a585870db54b1422dd54cd43","name":"Day Geoffrey","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.safewiper.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/015c8189f7189137cd7f52c7deada4c4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/015c8189f7189137cd7f52c7deada4c4?s=96&d=mm&r=g","caption":"Day Geoffrey"},"url":"https:\/\/www.safewiper.com\/blog\/author\/geoffrey"}]}},"_links":{"self":[{"href":"https:\/\/www.safewiper.com\/blog\/wp-json\/wp\/v2\/posts\/3051"}],"collection":[{"href":"https:\/\/www.safewiper.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.safewiper.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.safewiper.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.safewiper.com\/blog\/wp-json\/wp\/v2\/comments?post=3051"}],"version-history":[{"count":1,"href":"https:\/\/www.safewiper.com\/blog\/wp-json\/wp\/v2\/posts\/3051\/revisions"}],"predecessor-version":[{"id":3102,"href":"https:\/\/www.safewiper.com\/blog\/wp-json\/wp\/v2\/posts\/3051\/revisions\/3102"}],"wp:attachment":[{"href":"https:\/\/www.safewiper.com\/blog\/wp-json\/wp\/v2\/media?parent=3051"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.safewiper.com\/blog\/wp-json\/wp\/v2\/categories?post=3051"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.safewiper.com\/blog\/wp-json\/wp\/v2\/tags?post=3051"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}