Загрузка страницы

How to Get SHA-1 & SHA-256 Keys for Firebase | Android Studio & Keytool Methods (2025)

In this tutorial, you’ll learn **how to get SHA-1 and SHA-256 keys** for your Android app to integrate with **Firebase**, using both **Android Studio** and the **Keytool command-line method**. These keys are essential for enabling Firebase Authentication features like **Google Sign-In**, **Phone Auth**, and more.

Whether you’re building a new Flutter, Kotlin, or Java Android app, this step-by-step guide will show you how to retrieve your app’s **digital fingerprints** the right way.

---

### 📌 Why SHA-1 & SHA-256 Are Important?

Firebase requires the **SHA-1** and **SHA-256 certificate fingerprints** to verify your app’s authenticity and to enable features like:
- Google Sign-In Authentication
- Dynamic Links
- App Invites
- Phone Authentication
- Android App Integrity
- Firebase ML

---

### 🔧 Methods Covered in This Tutorial:

#### ✅ **Method 1: Using Android Studio**
1. Open your Android project in Android Studio.
2. Navigate to:
```
Gradle - Your Project - Tasks - android - signingReport
```
3. Double-click on `signingReport`.
4. SHA-1 and SHA-256 fingerprints will appear in the **Run** window for each build variant (debug/release).

#### ✅ **Method 2: Using Keytool (Command Line)**
1. Open a terminal (or CMD on Windows).
2. Run the following command:
```
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
```
- On Windows, use the full path:
`C:\Users\YourUsername\.android\debug.keystore`

3. SHA-1 and SHA-256 keys will be displayed in the output.

---

### 💡 Pro Tips:
- Always use the **correct keystore**:
- Use `debug.keystore` for development.
- Use your **release keystore** for production apps.
- Add both SHA-1 and SHA-256 keys to your **Firebase project settings** under Android App Registration.
- If you're using **Flutter**, you can still follow these steps from your Android module folder.

---

🔥 Don’t forget to:
✅ Like
✅ Comment
✅ Subscribe for more Android & Firebase tutorials!

📥 Drop your questions below if you face any issues getting your keys.

#SHA1 #SHA256 #Firebase #AndroidStudio #Keytool #FirebaseAuth #FlutterFirebase #AndroidDevelopment #FirebaseSetup #GoogleSignIn #SHAkeys #AndroidStudioTips

Видео How to Get SHA-1 & SHA-256 Keys for Firebase | Android Studio & Keytool Methods (2025) канала ProgrammingKnowledge
How to add SHA-1 and SHA256 in firebase?, How to generate SHA-1 and SHA256 keys?, How do I get a SHA-1 key?, How to convert SHA-1 to SHA-256?
Показать
Страницу в закладки Мои закладки
Все заметки Новая заметка Страницу в заметки