समस्या का हल करना & Android और Firebase के लिए अक्सर पूछे जाने वाले सवाल
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
इस पेज पर, Android से जुड़ी उन समस्याओं को हल करने के लिए सलाह दी गई है जो Firebase का इस्तेमाल करते समय आपके सामने आ सकती हैं.
क्या आपको कोई और समस्या आ रही है या आपको यहां अपनी समस्या नहीं दिख रही है? Firebase के सभी प्रॉडक्ट या किसी खास प्रॉडक्ट के बारे में अक्सर पूछे जाने वाले सवालों के लिए, Firebase के बारे में अक्सर पूछे जाने वाले सवाल देखें.
समस्याओं की अप-टू-डेट सूची और समस्या हल करने के तरीके जानने के लिए, Firebase Android SDK GitHub repo भी देखी जा सकती है. हमारा सुझाव है कि आप Firebase Android SDK से जुड़ी समस्याओं के बारे में भी वहां शिकायत करें!
मुझे यह गड़बड़ी का मैसेज मिल रहा है कि ktx लाइब्रेरी को हल नहीं किया जा सका या वह नहीं मिली.
यह गड़बड़ी शायद इसलिए हो रही है, क्योंकि Firebase BoM का इस्तेमाल किया जा रहा है. साथ ही, आपने KTX मॉड्यूल को अपनी प्रॉडक्ट लाइब्रेरी की डिपेंडेंसी के तौर पर सेट किया है.
हमने जुलाई 2025 से, KTX मॉड्यूल के नए वर्शन रिलीज़ करना बंद कर दिया है.
साथ ही, हमने KTX लाइब्रेरी को Firebase Android BoM (v34.0.0) से हटा दिया है.
अगर आपने पहले रिलीज़ किए गए KTX मॉड्यूल से KTX API का इस्तेमाल किया है, तो हमारा सुझाव है कि अपने ऐप्लिकेशन को मुख्य मॉड्यूल से KTX API का इस्तेमाल करने के लिए माइग्रेट करें. ज़्यादा जानकारी के लिए, इस पहल के बारे में अक्सर पूछे जाने वाले सवाल देखें.
क्या Android ऐप्लिकेशन को Firebase प्रोजेक्ट में जोड़ते समय, मुझे SHA-1 देना होगा?
मैं इस गड़बड़ी को कैसे ठीक करूं: "इस पैकेज के नाम और SHA-1 के लिए, किसी दूसरे प्रोजेक्ट में OAuth2 क्लाइंट पहले से मौजूद है"?
यह गड़बड़ी तब होती है, जब हमें पता चलता है कि किसी दूसरे Firebase या Google Cloud
प्रोजेक्ट में, आपके दिए गए पैकेज के नाम और SHA-1 के साथ OAuth 2.0 क्लाइंट आईडी मौजूद है. इस गड़बड़ी को ठीक करने का तरीका जानें.
अपने Android प्रोजेक्ट में Firebase जोड़ने पर, मुझे "नहीं मिला" गड़बड़ी का मैसेज मिलता है.
आम तौर पर, इस गड़बड़ी का मतलब यह होता है कि आपके ऐप्लिकेशन में Google की Maven रिपॉज़िटरी के एक या उससे ज़्यादा रेफ़रंस मौजूद नहीं हैं. पक्का करें कि आपने Google की Maven रिपॉज़िटरी
(google()) को अपनी Gradle कॉन्फ़िगरेशन फ़ाइल में शामिल किया हो.
अगर आपके प्रोजेक्ट में plugins सिंटैक्स का इस्तेमाल किया जा रहा है, तो इसे अपनी settings.gradle.kts या settings.gradle फ़ाइल के plugins सेक्शन में शामिल करें.
अगर आपके प्रोजेक्ट में buildscript सिंटैक्स का इस्तेमाल किया जा रहा है, तो इसे अपने प्रोजेक्ट-लेवल की build.gradle.kts या build.gradle फ़ाइल में, buildscript और allprojects, दोनों सेक्शन में शामिल करें.
अपने Android प्रोजेक्ट में Firebase SDK टूल जोड़ने पर, मुझे invoke-custom सपोर्ट और desugaring को चालू करने से जुड़ी गड़बड़ी मिलती है.
मई 2021 (Firebase BoM v28.0.0) में, Firebase ने अपनी सभी Android लाइब्रेरी के लिए, डिसुगरिंग की सुविधा बंद कर दी थी (रिलीज़ नोट देखें).
इस बदलाव का मतलब है कि Android Gradle प्लगिन (एजीपी) v4.2 या इससे पहले के वर्शन का इस्तेमाल करने वाले Gradle बिल्ड को Java 8 के साथ काम करने की सुविधा चालू करनी होगी. इसके अलावा, Firebase SDK टूल जोड़ते समय, इन Android प्रोजेक्ट में यह गड़बड़ी दिखती है:
D8: Invoke-customs are only supported starting with Android O (--min-api 26)
Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing.
The dependency contains Java 8 bytecode. Please enable desugaring by adding the following to build.gradle
android {
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
See https://developer.android.com/studio/write/java8-support.html for details.
Alternatively, increase the minSdkVersion to 26 or above.
बिल्ड फ़ेल होने की इस समस्या को ठीक करने के लिए, इनमें से कोई एक तरीका अपनाएं:
गड़बड़ी के मैसेज में दिए गए compileOptions को अपने ऐप्लिकेशन-लेवलbuild.gradle.kts या build.gradle फ़ाइल में जोड़ें.
अपने Android प्रोजेक्ट के लिए, minSdkVersion को 26 या उससे ज़्यादा पर सेट करें.
मैंने अपना ऐप्लिकेशन रिलीज़ कर दिया है. इसके बाद, Google खाते से साइन इन करने पर मुझे "12500:" गड़बड़ी दिख रही है. इसे कैसे ठीक किया जा सकता है?
ऐसा दो वजहों से हो सकता है: आपने सहायता के लिए ईमेल पता नहीं दिया है या आपके पास SHA कुंजी नहीं है. इस गड़बड़ी को ठीक करने के लिए, पक्का करें कि ये सभी शर्तें पूरी होती हों:
आपने Firebase कंसोल में मौजूद, Google Play कंसोल से SHA-1 सर्टिफ़िकेट फ़िंगरप्रिंट को Firebase कंसोल में मौजूद, Firebase Android ऐप्लिकेशन में जोड़ दिया हो. इसके लिए, settingsप्रोजेक्ट सेटिंग पर जाएं. इसके बाद, नीचे की ओर स्क्रोल करके आपके ऐप्लिकेशन पर जाएं और फिर अपना Android ऐप्लिकेशन चुनें.
buildscript
सिंटैक्स का इस्तेमाल करके, Android प्रोजेक्ट में Firebase प्लगिन कैसे जोड़े जाते हैं?
यहां बताया गया है कि buildscript सिंटैक्स का इस्तेमाल करने वाले Android प्रोजेक्ट में Firebase प्लगिन कैसे जोड़ा जाता है:
अपनी रूट-लेवल (प्रोजेक्ट-लेवल) Gradle फ़ाइल (<project>/build.gradle.kts या <project>/build.gradle) में, प्लगिन को Maven कोऑर्डिनेट का इस्तेमाल करके डिपेंडेंसी के तौर पर जोड़ें:
Kotlin
buildscript{repositories{// Make sure that you have the following two repositoriesgoogle()// Google's Maven repositorymavenCentral()// Maven Central repository}dependencies{...// Add the Maven coordinates and latest version of the pluginclasspath("PLUGIN_MAVEN_COORDINATES:PLUGIN_VERSION")}}allprojects{...repositories{// Make sure that you have the following two repositoriesgoogle()// Google's Maven repositorymavenCentral()// Maven Central repository}}
Groovy
buildscript{repositories{// Make sure that you have the following two repositoriesgoogle()// Google's Maven repositorymavenCentral()// Maven Central repository}dependencies{...// Add the Maven coordinates and latest version of the pluginclasspath'PLUGIN_MAVEN_COORDINATES:PLUGIN_VERSION'}}allprojects{...repositories{// Make sure that you have the following two repositoriesgoogle()// Google's Maven repositorymavenCentral()// Maven Central repository}}
अपनी मॉड्यूल (ऐप्लिकेशन-लेवल) Gradle फ़ाइल (आम तौर पर <project>/<app-module>/build.gradle.kts या <project>/<app-module>/build.gradle) में, प्लग इन के प्लग इन आईडी का इस्तेमाल करके प्लग इन जोड़ें:
Kotlin
plugins{id("com.android.application")// Add the ID of the pluginid("FIREBASE_PLUGIN_ID")...}
Groovy
plugins{id'com.android.application'// Add the ID of the pluginid'FIREBASE_PLUGIN_ID'...}
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 2025-07-21 (UTC) को अपडेट किया गया."],[],[],null,["\u003cbr /\u003e\n\nThis page offers tips and troubleshooting for Android-specific issues\nthat you might encounter when using Firebase.\n\nHave other challenges or don't see your issue outlined below? Make sure to check\nout the [main Firebase FAQ](/support/faq) for more pan-Firebase or\nproduct-specific FAQ.\n\nYou can also check out the\n[Firebase Android SDK GitHub repo](https://github.com/firebase/firebase-android-sdk/issues)\nfor an up-to-date list of reported issues and troubleshooting. We encourage you\nto file your own Firebase Android SDK related issues there, too! \n\nI'm getting an error that the `ktx` library failed to resolve or\ncould not be found.\n\nThis error is likely because you're using the Firebase BoM and\nspecifying a KTX module as your product library dependency.\n\n**In July 2025, we stopped releasing new versions of the KTX modules,\nand we removed the KTX libraries from the Firebase Android BoM\n(v34.0.0).**\n\nIf you use KTX APIs from previously released KTX modules, we recommend\nthat you ***migrate your app to use KTX APIs from the main modules\ninstead*** . For details, see the\n[FAQ about this initiative](/docs/android/kotlin-migration). \n\nDo I need to provide a SHA-1 when adding an Android app to a Firebase\nproject?\n\n[SHA-1 information](//developers.google.com/android/guides/client-auth)\nis required by Firebase Authentication (when using\n[Google signin](/docs/auth/android/google-signin) or\n[phone number signin](/docs/auth/android/phone-auth)) and\n[Firebase Dynamic Links](/docs/dynamic-links). If you're not using\nthese features, you don't have to provide a SHA-1. \n\nHow do I resolve this error: \"An OAuth2 client already exists for this\npackage name and SHA-1 in another project\"?\n\nThis error occurs if we detect that another Firebase or Google Cloud\nproject contains an OAuth 2.0 client ID with the package name\nand SHA-1 that you specified. Learn how to\n[resolve this error](//support.google.com/firebase/answer/6401008). \n\nWhen I add Firebase to my Android project, I get a \"Could not find\" error.\n\nThis error usually means that your app is missing one or more references\nto Google's Maven repository. Make sure to include Google's Maven repository\n(`google()`) in your Gradle Configuration file.\n\n- If your project is using the `plugins` syntax, include it in the `plugins` section in your `settings.gradle.kts` or `settings.gradle` file.\n- If your project is using the `buildscript` syntax, include it in both the `buildscript` and `allprojects` sections in your project-level `build.gradle.kts` or `build.gradle` file.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nWhen I add a Firebase SDK to my Android project, I get an error about\ninvoke-custom support and enabling desugaring.\n\n\u003cbr /\u003e\n\nIn May 2021 (Firebase BoM v28.0.0), Firebase disabled desugaring for all its\nAndroid libraries\n(see [release note](/support/release-notes/android#2021-05-11)).\n\nThis change means that Gradle builds that use Android Gradle plugin (AGP) v4.2\nor earlier need to enable Java 8 support. Otherwise, when adding a Firebase SDK,\nthese Android projects get the following build failure: \n\n```\nD8: Invoke-customs are only supported starting with Android O (--min-api 26)\nCaused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing.\nThe dependency contains Java 8 bytecode. Please enable desugaring by adding the following to build.gradle\nandroid {\n compileOptions {\n sourceCompatibility 1.8\n targetCompatibility 1.8\n }\n}\nSee https://developer.android.com/studio/write/java8-support.html for details.\nAlternatively, increase the minSdkVersion to 26 or above.\n```\n\nTo fix this build failure, you can follow one of two options:\n\n- Add the listed `compileOptions` from the error message to your **app-level** `build.gradle.kts` or `build.gradle` file.\n- Increase the `minSdkVersion` for your Android project to 26 or above.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nGoogle Sign-in is showing the error \"12500:\" after I released my app. How\ndo I fix it?\n\n\nThere are two possible reasons why this would happen: you haven't provided a\nsupport email or you're missing a SHA key. In order to fix this error, make\nsure **all** of these conditions are true:\n\n- You've added a support email to the [General Settings of your project](https://console.firebase.google.com/project/_/settings/general/) in the Firebase console.\n- You've added the [SHA-1 Certificate fingerprint from your release/production keystore](https://developers.google.com/android/guides/client-auth#using_keytool_on_the_certificate) to your Firebase Android App in the Firebase console (go to settings [**Project settings**](//console.firebase.google.com/project/_/settings/general/), scroll down to *Your apps*, and then select your Android App).\n- You've added the [SHA-1 Certificate fingerprint from the Google Play Console](https://developer.android.com/studio/publish/app-signing#api-providers) to your Firebase Android App in the Firebase console (go to settings [**Project settings**](//console.firebase.google.com/project/_/settings/general/), scroll down to *Your apps*, and then select your Android App).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nHow to add Firebase plugins to an Android project using the `buildscript`\nsyntax?\n\n\u003cbr /\u003e\n\n| **Tip:** Consider [migrating from `buildscript` to `plugin` syntax](https://developer.android.com/build/migrate-to-kotlin-dsl#migrate-buildscript) as this allows Android Studio to perform code completion and provide other helpful suggestions.\n\nFirebase has the following Gradle plugins:\n\n| Plugin name | Maven coordinates | Latest version | Plugin ID |\n|-------------------------------|-------------------------------------------------------|----------------|---------------------------------------|\n| Google Play services plugin | `com.google.gms:google-services` | 4.4.3 | `com.google.gms.google-services` |\n| App Distribution plugin | `com.google.firebase:firebase-appdistribution-gradle` | 5.1.1 | `com.google.firebase.appdistribution` |\n| Crashlytics plugin | `com.google.firebase:firebase-crashlytics-gradle` | 3.0.6 | `com.google.firebase.crashlytics` |\n| Performance Monitoring plugin | `com.google.firebase:perf-plugin` | 2.0.1 | `com.google.firebase.firebase-perf` |\n\n\u003cbr /\u003e\n\nHere's how to add a Firebase plugin to an Android project that still uses the\n`buildscript` syntax:\n\n1. In your **root-level (project-level)** Gradle file\n (`\u003cproject\u003e/build.gradle.kts` or `\u003cproject\u003e/build.gradle`), add the plugin as\n a dependency using its Maven coordinates:\n\n Kotlin \n\n buildscript {\n\n repositories {\n // Make sure that you have the following two repositories\n google() // Google's Maven repository\n mavenCentral() // Maven Central repository\n }\n\n dependencies {\n ...\n\n // Add the Maven coordinates and latest version of the plugin\n classpath (\"\u003cvar translate=\"no\"\u003ePLUGIN_MAVEN_COORDINATES\u003c/var\u003e:\u003cvar translate=\"no\"\u003ePLUGIN_VERSION\u003c/var\u003e\")\n }\n }\n\n allprojects {\n ...\n\n repositories {\n // Make sure that you have the following two repositories\n google() // Google's Maven repository\n mavenCentral() // Maven Central repository\n }\n }\n\n Groovy \n\n buildscript {\n\n repositories {\n // Make sure that you have the following two repositories\n google() // Google's Maven repository\n mavenCentral() // Maven Central repository\n }\n\n dependencies {\n ...\n\n // Add the Maven coordinates and latest version of the plugin\n classpath '\u003cvar translate=\"no\"\u003ePLUGIN_MAVEN_COORDINATES\u003c/var\u003e:\u003cvar translate=\"no\"\u003ePLUGIN_VERSION\u003c/var\u003e'\n }\n }\n\n allprojects {\n ...\n\n repositories {\n // Make sure that you have the following two repositories\n google() // Google's Maven repository\n mavenCentral() // Maven Central repository\n }\n }\n\n2. In your **module (app-level)** Gradle file (usually\n `\u003cproject\u003e/\u003capp-module\u003e/build.gradle.kts` or\n `\u003cproject\u003e/\u003capp-module\u003e/build.gradle`), add the plugin using its\n plugin ID:\n\n Kotlin \n\n plugins {\n id(\"com.android.application\")\n\n // Add the ID of the plugin\n id(\"\u003cvar translate=\"no\"\u003eFIREBASE_PLUGIN_ID\u003c/var\u003e\")\n ...\n }\n\n Groovy \n\n plugins {\n id 'com.android.application'\n\n // Add the ID of the plugin\n id '\u003cvar translate=\"no\"\u003eFIREBASE_PLUGIN_ID\u003c/var\u003e'\n ...\n }\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e"]]