Skip to main content

Google Cloud & config files

Everything you need in Google Cloud / Firebase before testing sign-in. Applies to bare React Native and Expo.

Labels used in this guide:

LabelMeaning
RequiredNeeded for sign-in to work in production-like builds
Required for autoDetectOnly when webClientId: 'autoDetect'
OptionalSkip unless noted; use when you want convenience or a specific setup path

Quick checklist

StepWhy
Google Cloud / Firebase projectRequiredOAuth clients and config files live in a Google project
OAuth consent screenRequiredGoogle blocks sign-in for production/testing users without it
Web + Android + iOS OAuth clientsRequiredEach platform validates package/bundle and issues tokens
Android SHA-1 fingerprintsRequired (Android)Google matches your signing certificate; missing SHA-1 → DEVELOPER_ERROR
iOS URL scheme (REVERSED_CLIENT_ID)Required (iOS)OAuth redirect must return to your app
google-services.json + Android Gradle pluginRequired for autoDetectGenerates default_web_client_id on Android
GoogleService-Info.plistRequired for autoDetect on iOSSupplies WEB_CLIENT_ID; also easiest source for URL scheme
Firebase download pathOptionalAlternative to manual OAuth setup; same files
Explicit webClientId in JSOptionalSkips Android JSON + Gradle; you still need SHA-1 (Android) and URL scheme (iOS)
androidx.credentials in your app GradleOptional (omit)Shipped by the library — Android Credential Manager & GMS
// Required for autoDetect on both platforms:
GoogleOneTapSignIn.configure({ webClientId: 'autoDetect' })

// Optional path — no google-services.json on Android:
GoogleOneTapSignIn.configure({
webClientId: 'YOUR_WEB_CLIENT_ID.apps.googleusercontent.com',
})

Config files are gitignored in this repo — use your own project.


1. Create a Google Cloud project

Required

Why: OAuth client IDs, consent screen, and (via Firebase) google-services.json / GoogleService-Info.plist are all tied to a Google Cloud project. Without a project you cannot register your app with Google.

  1. Open Google Cloud Console or Firebase Console (linked to the same Cloud project).
  2. Create or select a project.

Required

Why: Google shows the consent screen to users. An incomplete or missing consent configuration blocks sign-in or limits which Google accounts can authenticate.

Configure the OAuth consent screen (app name, support email, scopes).


3. Create OAuth clients

Required

Why: Each platform uses a different client type. The Web client ID is what you pass as webClientId (or embed in config files for autoDetect). Android and iOS clients tie Google to your package name / bundle ID and certificates.

In APIs & Services → Credentials, create:

TypeUsed for
Web applicationwebClientId; backend ID token verification
AndroidPackage name + SHA-1
iOSBundle ID; REVERSED_CLIENT_ID for URL scheme

Web client ID

Optional if you only use autoDetect

Why optional: With autoDetect, the Web client ID can come from google-services.json / plist. You still need a Web OAuth client in the same project for token validation on your backend.

Copy the Web client ID (ends with .apps.googleusercontent.com) if you configure manually.

Android OAuth client (Google Cloud)

Create an Android OAuth client in Google Cloud Console

iOS OAuth client (Google Cloud)

Create an iOS OAuth client and download plist from Google Cloud


4. Android SHA-1

Required on Android

Why: Google Sign-In checks that the app requesting tokens is signed with a certificate you registered. Wrong or missing SHA-1 causes DEVELOPER_ERROR even when everything else is correct.

Get your debug keystore SHA-1:

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

Bare RN project keystore:

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

Register the fingerprint in Google Cloud (Android OAuth client) and/or Firebase (Project settings → Android app).

Add SHA-1 fingerprint on the Android OAuth client in Google Cloud Console

Required for release

Why: Play Store builds use different certificates. Add release and Play App Signing SHA-1 values before shipping production.


5. Download config files

google-services.json (Android)

Required for autoDetect on Android

Why: The Google Services Gradle plugin reads this file and generates the default_web_client_id string resource. Native code reads that resource when webClientId is 'autoDetect'.

Optional with explicit webClientId

Why optional: If you pass the Web client ID string in configure(), Android does not need this file — but SHA-1 is still required.

Download google-services.json from Firebase

GoogleService-Info.plist (iOS)

Required for autoDetect on iOS

Why: Native code reads WEB_CLIENT_ID from the plist when using autoDetect. Firebase-generated plists include it.

Optional for explicit webClientId only

Why optional for client ID: You can pass webClientId in JS instead. You still need the iOS URL scheme (see iOS setup) — the plist is the easiest way to get REVERSED_CLIENT_ID.

Download GoogleService-Info.plist from Firebase

Optional path (recommended)

Why use it: One console for Android + iOS apps, SHA-1 management, and downloading both files with matching OAuth metadata.

  1. Firebase Console → your project.
  2. Add app → Android — package = your applicationId → download google-services.json
  3. Add app → iOS — bundle ID = your bundleIdentifier → download GoogleService-Info.plist
  4. Add SHA-1 (§4); re-download JSON if Firebase prompts.
FilePlatformProvides
google-services.jsonAndroiddefault_web_client_id + Gradle integration
GoogleService-Info.plistiOSWEB_CLIENT_ID, REVERSED_CLIENT_ID

6. Where to put the files

Required when using those files

Why: Build tools only read config from known paths. Wrong location = missing resources at runtime.

Environmentgoogle-services.jsonGoogleService-Info.plist
Bare React Nativeandroid/app/google-services.jsonXcode app target
ExpoPath in app.config (e.g. ./google-services.json)e.g. ./GoogleService-Info.plist
Repo example/example/android/app/iOS Xcode target
Repo example-expo/example-expo/example-expo/

Bare React Native

StepWhy
Copy google-services.jsonandroid/app/Required for autoDetectGradle plugin input location
Gradle pluginRequired for autoDetectProcesses JSON into default_web_client_id
Plist in Xcode + URL schemeRequired (iOS)Redirect + autoDetect on iOS
AppDelegate handle(url)Optional (recommended bare RN)Forwards OAuth redirect to GIDSignIn

Expo

StepWhy
googleServicesFile in app.configRequired for autoDetectPlugin copies files at prebuild
expo prebuildRequired after native config changesApplies plugin + Gradle
Manual Gradle editsOptionalConfig plugin applies Gradle for you
AppDelegate patch after prebuildOptionalOnly if sign-in stalls or you have other URL handlers
plugins: ['react-native-nitro-google-signin'],
android: { googleServicesFile: './google-services.json' },
ios: { googleServicesFile: './GoogleService-Info.plist' },

7. Verify config files

Optional but recommended

Why: Catches package name / bundle ID mismatches before long native rebuild cycles.

  • google-services.jsonpackage_name matches applicationId
  • GoogleService-Info.plist — contains REVERSED_CLIENT_ID; WEB_CLIENT_ID for autoDetect

8. Sample apps in this repo

Optional

Why: Only needed if you run the bundled examples. Use package/bundle com.nitrogooglesigninexample or change app configs to match your files.

AppConfig file locations
example/example/android/app/ + iOS Xcode
example-expo/example-expo/

Required for backend token verification

Why: ID tokens from Android/iOS must correspond to the same Google project as your Web client so your server can verify them with Google's public keys.

Ensure Web, Android, and iOS clients live in the same Google Cloud project.

See also Android setup and iOS setup for platform-specific config file steps.


Troubleshooting

IssueFix
default_web_client_id was not foundJSON + Gradle plugin + matching package name
DEVELOPER_ERROR (Android)SHA-1 / package name
iOS redirect errorsURL scheme = REVERSED_CLIENT_ID
Expo changes ignoredexpo prebuild --clean + rebuild dev client

Android · iOS · Expo · Troubleshooting.