high · M8 · MASVS-PLATFORM-1 · PTKD-REVIEW-PLAY-FGS-TYPE

    Foreground service type or permission missing (Android 14+)

    Apps targeting Android 14 (API 34) or higher must give every foreground service a type and hold the matching FOREGROUND_SERVICE_<TYPE> permission; otherwise startForeground() throws and the feature crashes. Google Play also asks for a foreground service declaration (with a video) for each type the app uses.

    How it is exploited

    A fitness app targets API 35 and starts a location-tracking service with startForeground(). The service has no foregroundServiceType, so on Android 14+ the call throws MissingForegroundServiceTypeException and every run crashes. Play also rejects the update because the foreground service declaration in Play Console is missing.

    Why it matters

    Crashes on Android 14+ devices, and a rejected update until the Play Console declaration is complete.

    How to fix it

    1. List every service you start with startForeground() (including services from SDKs in the merged manifest).
    2. Give each one android:foregroundServiceType (location, mediaPlayback, dataSync, ...) and request the matching android.permission.FOREGROUND_SERVICE_<TYPE>.
    3. In Play Console, open App content, Foreground service permissions, and describe each type with a short video of the feature.
    4. If the work can wait or be interrupted, use WorkManager or a shortService instead of a typed foreground service.

    Does your app have this?

    PTKD checks your build or your source project for PTKD-REVIEW-PLAY-FGS-TYPE and every other check in this knowledge base.

    Scan your app

    References

    Related checks (M8)