Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App showing ANR(App Not Responding) #1400

Open
mpriyanka2k opened this issue Jan 4, 2025 · 0 comments
Open

App showing ANR(App Not Responding) #1400

mpriyanka2k opened this issue Jan 4, 2025 · 0 comments

Comments

@mpriyanka2k
Copy link

mpriyanka2k commented Jan 4, 2025

Below are the older stable and functional versions of the libraries and tools integrated into my Flutter application:

1.flutter_background_geolocation(Version: 4.12.3) - Transistor Software
2. Flutter SDK: Version 3.16.9
3. Android Studio: Giraffe | 2022.3.1
4. permission_handler: Version 11.0.1
5. location: Version 4.0.0

The current versions of libraries and tools integrated into my Flutter application are as follows:

  1. flutter_background_geolocation: Version 4.16.6 (Transistor Software)
  2. Flutter SDK: Version 3.24.3
  3. Android Studio: Hedgehog | 2023.1.1 Patch 2
  4. permission_handler: Version 11.3.1
  5. location: Version 7.0.0

Additionally, the following configurations have been added to the AndroidManifest.xml file:

<meta-data android:name="com.transistorsoft.locationmanager.license" android:value="our_key" />
<service android:name="com.transistorsoft.locationmanager.service.TrackingService" android:foregroundServiceType="location" android:exported="false" />
<service android:name="com.transistorsoft.locationmanager.service.LocationRequestService" android:foregroundServiceType="location" android:exported="false" />
<uses-permission android:minSdkVersion="34" android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

Application Overview (CDP EAS):
My application leverages flutter_background_geolocation 4.16.6 for consistently tracking user location in the background. This functionality ensures accurate activity tracking and precise distance calculations for users.

Issues Encountered:

  1. Slow Execution and ANR During Registration:

    • When location permissions are granted on the Android device, the registration process (via RegisterHeadlessTask) takes a significantly long time to execute and respond.
    • Additionally, during execution, the application encounters ANR (App Not Responding) errors.
    • Note: Within the RegisterHeadlessTask specifically, tasks related to latitude and longitude processing are being performed.
  2. Functionality Despite Denied Location Permissions:

    • After successful registration on RegisterHeadlessTask, the application continues to function properly, even when location permissions are subsequently denied.

Debug logs

Fatal Exception: android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground()
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1771)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6518)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant