Why am I getting "Invalid project selection" error during Firebase deployment?
Last updated: December 17, 2025
Context
When running a pre-publish script for Firebase deployment in Codemagic, you may encounter an error message that says Invalid project selection, please verify project [project-name] exists and you have access.
Answer
The Invalid project selection error indicates that Firebase cannot find or access the specified project. This is typically caused by an incorrect or missing project configuration in your .firebaserc file.
To resolve this issue:
Check your
.firebasercfile in your project root directoryVerify that it contains the correct project configuration with your actual Firebase project ID:
{ "projects": { "production": "your-actual-project-id" } }Ensure that the project ID matches exactly with your Firebase project (case-sensitive)
Confirm that your Google Application Credentials have access to the specified Firebase project
Note: If you see deprecation warnings about FIREBASE_TOKEN, these are just warnings and not errors. The actual deployment failure is caused by the project selection issue, not the token deprecation warning.