All skills
firebase avatar

/firebase-basics

@073edf7
by firebasefirebase/skills461 stars
102

Provides foundational Firebase CLI setup, CLI installation, version checks (`firebase-tools@latest --version`), CLI login (including --no-localhost), project creation, project selection (`firebase use`), and app config file downloads (`google-services.json`, `GoogleService-Info.plist`). Use ONLY for CLI login, project creation/switching, or downloading app config files. Don't use for Firebase Hosting deploy, Firestore, Auth, App Hosting, Data Connect, Crashlytics, or Remote Config.

Use this Skill: https://skilld.dev/gh/firebase/skills/firebase-basics

This session only. Nothing lands on disk.

referencesandroid_setup.md

≈1.4k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Firebase Android Setup Guide


Prerequisites

  1. Firebase CLI: Make sure the Firebase CLI is available and authenticated.

    For detailed instructions about the Firebase CLI, see firebase_basics/references/local-env-setup. Here are high-level instructions for setting up the Firebase CLI.

    1. Ensure the Firebase CLI is available:

      npx -y firebase-tools@latest --version
    2. Login to the CLI:

      • local:

        npx -y firebase-tools@latest login
      • remote servers:

        npx -y firebase-tools@latest login --no-localhost
  2. Android project: Create or use an existing Android project in an Android-development IDE.


1. Check if the Android project is connected to a Firebase Project

Check if the Android project already has a google-services.json file in its module (app-level) root directory.

google-services.json file is present

If the Android project already has a google-services.json file, do NOT create a new Firebase project or re-register the app — skip steps 2 through 4 below. Instead, verify the existing Firebase setup within the codebase and fix anything that is missing:

  • The google-services.json file is in the module (app-level) root directory: app/google-services.json

  • The Google services Gradle plugin (google-services) is added to both the project-level and module (app-level) Gradle build files. If it is missing from either file, add it by following step 5 below.

google-services.json file is NOT present

If the Android project does NOT already have a google-services.json file, then proceed with the remaining steps in this guide.


2. Create a new Firebase project or use an existing one

Check if there's an existing Firebase Project available for use with the Android project:

npx -y firebase-tools@latest projects:list
  • If existing Firebase Project: Ask the human user if they want to use the existing project.

  • If no existing Firebase Project or human user does not want to use an existing project: Create a new Firebase Project.

    Provide a required unique PROJECT_ID and an optional PROJECT_DISPLAY_NAME:

    npx -y firebase-tools@latest projects:create <UNIQUE_PROJECT_ID> --display-name <PROJECT_DISPLAY_NAME>

    Example:

    npx -y firebase-tools@latest projects:create my-cool-app-20260330 --display-name MyCoolApp

3. Register the Android project

Register the app module (package name) of the Android project with the Firebase project. Provide an optional APP_DISPLAY_NAME and required PACKAGE_NAME:

npx -y firebase-tools@latest apps:create ANDROID <APP_DISPLAY_NAME> --package-name <PACKAGE_NAME> --project <PROJECT_ID>

Example:

npx -y firebase-tools@latest apps:create ANDROID MyApplication --package-name com.example.myapplication --project my-cool-app-20260330

NOTE: A package name is often referred to as an application ID within an Android project. Find an app's package name in the module (app-level) Gradle file, usually app/build.gradle.kts.


4. Obtain and save google-services.json

  1. Fetch the Firebase configuration file (google-services.json) using the Firebase Android APP_ID (which is printed in the output of the previous apps:create command):

    npx -y firebase-tools@latest apps:sdkconfig ANDROID <APP_ID> --project <PROJECT_ID>
  2. Save the configuration file within the module (app-level) root directory of the Android project: app/google-services.json


5. Add the google-services plugin

[!IMPORTANT] [AGENT] RESOLVING THE PLUGIN VERSION DETERMINISTICALLY Never guess or hardcode a memorized out-of-date plugin version. Before adding dependencies, you MUST query the latest available versions directly from the Google Maven Repository:

# Find the latest Google services Gradle plugin version
curl -s https://dl.google.com/dl/android/maven2/com/google/gms/google-services/maven-metadata.xml | grep -oE '<latest>[^<]+' | cut -d'>' -f2

These changes are made to the Android project's Gradle files.

Project-level build.gradle.kts (<project>/build.gradle.kts)

Add the latest version of the Google services Gradle plugin to the plugins block:

plugins {
    // ... other plugins

    // [AGENT] Fetch the latest resolved version using the Gradle command above
    id("com.google.gms.google-services") version "<latest_plugin_version>" apply false
}

Module (app-level) build.gradle.kts (<project>/<app-module>/build.gradle.kts)

Add the Google services Gradle plugin to the plugins block:

plugins {
    // ... other plugins
    id("com.google.gms.google-services")
}

Verification plan

Manual verification

Validate that the Firebase Project was created and the Firebase Android App was registered successfully:

npx -y firebase-tools@latest projects:list
npx -y firebase-tools@latest apps:list --project <PROJECT_ID>

Source: SKILL.md on GitHub

2 warningstoday5 checks · Risk SAFE
  • Gen Agent Trust Hubtoday

    This skill provides a comprehensive suite of instructions for initializing and managing Firebase projects across various development environments. It follows standard industry practices for setting up cloud infrastructure, including downloading tools from official sources (npm, Google, GitHub) and configuring local environments. The 'low' verdict is assigned due to the inherent attack surface for indirect prompt injection when processing user-supplied identifiers like Project IDs in shell commands, though no malicious intent was detected.

  • Sockettoday

    1 alert: gptAnomaly

  • Snyktoday

    Risk: LOW · No issues

  • Runlayer6mo

    2 files scanned · No issues

  • ZeroLeaks5mo

    1 finding · Score: 69/100

Signed by skilld at 073edf7. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 2 months ago
metadata
{
  "category": "CloudInfrastructureAndServices"
}
  • firebase
  • firebase-cli
  • authentication
  • project-setup
  • google-services
  • web
  • android
  • ios

README badge

README badge for firebase/skills/firebase-basics

Provides foundational Firebase CLI setup, authentication, and project management for initializing Firebase environments. Use for checking the Firebase CLI version, logging in, setting active projects, and retrieving config files like google-services.json for Android or GoogleService-Info.plist for iOS.

Generated from the current SKILL.md.

Does this skill handle Firebase authentication setup?
Yes. It covers Firebase CLI authentication via `npx -y firebase-tools@latest login`, including the `--no-localhost` flag for environments without a browser.
What Firebase operations does this skill support?
It provides CLI-based workflows for checking Firebase CLI version, initializing Firebase environments, authenticating, managing active projects, and retrieving `google-services.json` and `GoogleService-Info.plist` config files for Android and iOS apps.
Can I use this skill to create a new Firebase project?
Yes. The skill includes the `npx -y firebase-tools@latest projects:create` command to create new projects with a globally unique project ID.
Does this skill work with Genkit?
The skill acknowledges Genkit usage and notes that the genkit-ai/skills package should be installed separately when using Genkit.

Generated from the current SKILL.md. These answers refresh after source changes.