This project uses environment variables to securely manage Firebase configuration and API keys. The actual google-services.json file is NOT committed to Git to prevent API key exposure.
git clone https://github.com/Salmanmalvasi/test_student.git
cd test_student# Copy the example environment file
cp .env.example .env
# Edit .env with your actual Firebase configuration
nano .env # or use your preferred editor# Generate google-services.json from environment variables
./generate-config.sh
# Or generate and build in one step
./generate-config.sh --build# Clean build
./gradlew clean
# Build release APK
./gradlew assembleRelease| Variable | Description | Example |
|---|---|---|
FIREBASE_API_KEY |
Firebase API Key | AIzaSyB... |
FIREBASE_PROJECT_ID |
Firebase Project ID | studentcc-16b86 |
FIREBASE_PROJECT_NUMBER |
Firebase Project Number | 903476342662 |
FIREBASE_APP_ID |
Firebase App ID | 1:903476342662:android:... |
FIREBASE_STORAGE_BUCKET |
Firebase Storage Bucket | project.firebasestorage.app |
- β API keys stored in environment variables
- β
.envfile excluded from Git - β Template-based configuration generation
- β Build script automation
- β No sensitive data in repository
- Go to Firebase Console
- Select your project
- Go to Project Settings β General
- Scroll to Your apps section
- Click Add app or select existing Android app
- Download
google-services.json - Extract the values and add them to your
.envfile
Error: .env file not found!Solution: Copy .env.example to .env and fill in your values.
Error: Required environment variable FIREBASE_API_KEY is not set!Solution: Check that all required variables are set in your .env file.
- Make sure
google-services.jsonexists:./generate-config.sh - Clean and rebuild:
./gradlew clean assembleRelease
When contributing:
- NEVER commit actual API keys or
google-services.json - Only commit the
.templatefiles - Update
.env.exampleif adding new environment variables - Test the build script before submitting PRs