# Fix 'Invalid or Incomplete Foreground Service (FGS) Permission Declaration' in Play Console

> Exact Error: `Invalid or incomplete Foreground Service (FGS) permission declaration`

- **Canonical URL**: https://gootester.com/errors/foreground-service-type-missing-or-rejected

## Step-by-Step Resolution
1. **Audit merged AndroidManifest.xml for every FOREGROUND_SERVICE* entry**: Run bundletool dump manifest --bundle=app-release.aab | grep -i foreground to list both <uses-permission> tags and <service android:foregroundServiceType="..."> declarations.
2. **Remove unneeded FGS permissions and services if your app runs foreground-only**: If your app does not legitimately need continuous user-noticeable background execution, use tools:node="remove" on transitive FGS permissions/services and replace background tasks with standard WorkManager.
3. **Migrate large file uploads/downloads to WorkManager or userInitiatedDataTransfer**: Prefer WorkManager Constraints and setExpedited() for quick syncs, eliminating the need for Play Console's FGS declaration form altogether.
4. **Record an explicit 30–60s screencast if your core feature truly requires FGS**: For genuine audio players, fitness GPS trackers, VoIP calls, or BLE medical sensors, record a phone screen showing the user starting the feature, locking/minimizing the app, and interacting with the persistent system notification.
5. **Supersede older FGS-bearing bundles across Internal and Closed tracks**: Upload the cleaned .aab across all active testing tracks so old Internal Testing artifacts do not keep triggering the FGS App Content requirement.

```xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <!-- Remove accidental FGS permissions merged by unused plugin modules -->
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" tools:node="remove" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" tools:node="remove" />

    <application>
        <service
            android:name="androidx.work.impl.foreground.SystemForegroundService"
            tools:node="remove" />
    </application>
</manifest>
```

## Why Android 14, 15 & 16 Tightened Foreground Service (FGS) Enforcement

Starting with Android 14 (API 34) and intensifying in Android 15 (API 35 — strict 6-hour `dataSync` / `mediaProcessing` timeouts and boot-receiver restrictions) and Android 16 (API 36), Google requires every Foreground Service to declare a granular `android:foregroundServiceType` (`camera`, `connectedDevice`, `dataSync`, `health`, `location`, `mediaPlayback`, `mediaProjection`, `microphone`, `phoneCall`, `remoteMessaging`, `shortService`, or `specialUse`) paired with its matching `android.permission.FOREGROUND_SERVICE_<TYPE>` permission.
Whenever Play Console detects *any* typed `FOREGROUND_SERVICE_*` permission inside an `.aab` uploaded to Internal, Closed, Open, or Production tracks, it unlocks a mandatory **Foreground service permissions** declaration under `Monitor and improve -> Policy and programs -> App content`. You cannot roll out your Closed Testing track until either (a) Google Play human reviewers approve your task justification and video proof, or (b) you strip the unneeded FGS declarations from every active track.
Avoid using the catch-all `FOREGROUND_SERVICE_SPECIAL_USE` escape hatch unless no standard Android FGS category covers your domain; Google Play reviewers manually audit every `specialUse` submission and routinely reject apps trying to disguise generic background polling.

## Removing Accidental FGS Permissions vs. Passing Legitimate FGS Video Review

Ask one blunt architectural question first: **if the user presses the Home button, would they be upset or surprised if an undismissable notification stayed pinned in their Android notification shade?** If your app is a habit tracker, note-taking tool, AI chat client, e-commerce store, or puzzle game, it has zero reason to hold a typed Foreground Service! Strip the transitive `FOREGROUND_SERVICE_*` tags injected by notification or background-fetch plugins using `tools:node="remove"` (remembering not to call `setExpedited` with foreground fallback if stripping `SystemForegroundService`). Removing the permission deletes the entire policy hurdle instantly.
Conversely, if you are shipping a running/cycling GPS tracker (`location`), a meditation or podcast player (`mediaPlayback`), a Pomodoro alarm timer, or a Bluetooth OBD-II scanner (`connectedDevice`), keep only that single exact FGS type and record a crisp, unedited 45-second screen capture on a real Android phone. Show the user tapping Start inside your app, swiping to the Android home screen, pulling down the notification shade to reveal your active ongoing FGS notification, and returning to the app.
Ensure the video URL pasted into Play Console loads directly in an incognito browser tab with zero Google Drive request-access walls, and keep the app's UI language in English (or captioned clearly) so policy reviewers verify the user-initiated trigger in seconds.

## Preventing API 35 `ForegroundServiceStartNotAllowedException` Crashes in Closed Testing

Passing Play Console's paperwork review is only half the battle: on Android 15/16 devices, starting a `dataSync` or `location` Foreground Service from `BOOT_COMPLETED` or while your app is in the background throws an immediate fatal `ForegroundServiceStartNotAllowedException` (or `TimeLimitExceededException` if `Service.onTimeout()` is unhandled after 6 hours of `dataSync`), spiking your Android Vitals crash rate.
Validate real lifecycle transitions on physical ARM64 hardware before and during your 14-day closed test — GOOtester's Standard ($12) and Premium ($20) plans run separate physical-device ADB QA alongside your 15 or 25 consented human testers.
Always implement `onTimeout(int startId, int fgsType)` inside any `Service` subclass targeting API 35+ to call `stopSelf()` gracefully within a few seconds, preventing Android 15+ from forcefully crashing your process.
