# COLORJET Engineer Android Build Guide

## Fixed application identity

```text
Android package: com.colorjetbd.managementsuite
Firebase project: flutter-ai-playground-410ea
Firebase Android App ID: 1:475854312836:android:c68d85ee194443660c39d1
```

The matching Firebase client file is already included as:

```text
mobile-engineer/google-services.json
```

Do not replace it with the older client registered for `com.colorjetbd.app`.

## Install and validate

```bash
cd mobile-engineer
npm install
npm run typecheck
npx expo install --check
npx expo config --type public
npx expo-doctor
```

## Runtime API setting

Create `mobile-engineer/.env` from `.env.example`:

```env
EXPO_PUBLIC_API_BASE_URL=https://<YOUR_ERP_DOMAIN>/api
```

Do not put database passwords, JWT secrets, Firebase service-account keys or cPanel credentials in any `EXPO_PUBLIC_*` variable.

## Link the Expo/EAS project

Firebase App ID and EAS Project ID are different. Authenticate with the Expo account that owns the app and link the source:

```bash
npx eas-cli@latest login
npx eas-cli@latest init
```

After linking, verify that `extra.eas.projectId` contains the real EAS UUID or that the build exposes `Constants.easConfig.projectId`.

## Configure Android push credentials

```bash
npx eas-cli@latest credentials --platform android
```

Configure FCM V1 for the same Firebase project. Never add a Firebase Admin service-account private key to the mobile source repository.

## Build profiles

Preview APK:

```bash
npx eas-cli@latest build --platform android --profile preview
```

Production AAB:

```bash
npx eas-cli@latest build --platform android --profile production
```

The production profile uses `app-bundle` and auto-increments the version code.

## Existing Play Console app rule

For an update to the existing Play Console listing:

- Keep package `com.colorjetbd.managementsuite` unchanged.
- Use the existing approved upload key, or complete Google's upload-key reset process first.
- Do not generate a random replacement keystore and assume it can update the existing listing.
