Skip to content

App Crash above android version 12 when i use flutter_foreground_task plugin for notification & location permission #348

Open

Description

@mobilem3
No description provided.

Activity

  1. cristianlima-bit commented on Jun 13, 2025

    @cristianlima-bit

    same error here, using flutter 3.32.1, any solution @mobilem3 ?

  2. Dev-hwang commented on Jul 6, 2025

    @Dev-hwang
    Owner
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    
    <service
       android:name="com.pravera.flutter_foreground_task.service.ForegroundService"
       android:foregroundServiceType="location"
       android:exported="false" />
    
    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel stable, 3.32.5, on macOS 15.4 24E248 darwin-x64, locale ko-KR)
    [✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    [✓] Xcode - develop for iOS and macOS (Xcode 16.2)
    [✓] Chrome - develop for the web
    [✓] Android Studio (version 2024.2)
    [✓] VS Code (version 1.99.2)
    

    Please make sure that location permission is granted before starting the foreground service. In my tests on the target platform environment(samsung device, android studio simulator), the service ran without any issues. There is also a possibility of a conflict with the location library, so if you are using one, please let me know which library you are using.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions