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

Application showing ANR(App Not Responding) #1431

Closed
3 of 5 tasks
mpriyanka2k opened this issue Jan 28, 2025 · 2 comments
Closed
3 of 5 tasks

Application showing ANR(App Not Responding) #1431

mpriyanka2k opened this issue Jan 28, 2025 · 2 comments
Assignees
Labels
status: closed (missing info) Indicates the issue was automatically closed due to a lack of information. status: needs more info We need more information before we can continue work on this issue.

Comments

@mpriyanka2k
Copy link

mpriyanka2k commented Jan 28, 2025

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Windows

Steps to reproduce

When location permission is granted, the app displays a "Too much work on the main thread" message and triggers an ANR (App Not Responding) popup. However, the app functions properly when location permission is denied.

Expected results

If location permissions are granted, then want to an application will function properly.

Actual results

When location permission is granted, the app displays a "Too much work on the main thread" message and triggers an ANR (App Not Responding) popup. However, the app functions properly when location permission is denied.

Code sample

#AndroidManifest.xml

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />

<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.front" />
<uses-feature android:name="android.hardware.camera2" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<uses-feature android:name="android.hardware.camera.flash" android:required="false" />
<uses-permission android:minSdkVersion="34" android:name="android.permission.USE_EXACT_ALARM" />
// not in use now
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

// for samsung android version 14
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:minSdkVersion="34" android:name="android.permission.FOREGROUND_SERVICE_HEALTH"/>
<uses-permission android:minSdkVersion="34" android:name="android.permission.FOREGROUND_SERVICE_LOCATION"/>
<uses-permission android:minSdkVersion="34" android:name="android.permission.USE_FULL_SCREEN_INTENT"/>


<application
    android:name=".Application"
    tools:replace="android:label"
    android:label="EAS"
    android:extractNativeLibs="false"
    android:icon="@mipmap/launcher_icon"
    android:hardwareAccelerated="false"
    android:largeHeap="true"
    android:networkSecurityConfig="@xml/network_security_config"
    android:usesCleartextTraffic="true"
    android:allowBackup="false"
    android:fullBackupOnly="false"
>


    <meta-data android:name="com.transistorsoft.locationmanager.license" android:value="our_key" />

    <meta-data android:name="com.google.firebase.messaging.default_notification_icon"
        android:resource="@mipmap/launcher_icon" />
    <meta-data
        android:name="com.google.mlkit.vision.DEPENDENCIES"
        android:value="face" />
    <!-- To use multiple models: android:value="ica,model2,model3" -->
    <activity
        android:name=".MainActivity"
        android:exported="true"
        android:launchMode="singleTop"
        android:theme="@style/LaunchTheme"
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
        android:hardwareAccelerated="false"
        android:largeHeap="true"
        android:windowSoftInputMode="adjustResize">

        <!-- Specifies an Android theme to apply to this Activity as soon as
             the Android process has started. This theme is visible to the user
             while the Flutter UI initializes. After that, this theme continues
             to determine the Window background behind the Flutter UI. -->


        <meta-data
            android:name="io.flutter.embedding.android.NormalTheme"
            android:resource="@style/NormalTheme"
            />
        <!-- Displays an Android View that continues showing the launch screen
             Drawable until Flutter paints its first frame, then this splash
             screen fades out. A splash screen is useful to avoid any visual
             gap between the end of Android's launch screen and the painting of
             Flutter's first frame. -->
        <meta-data
            android:name="io.flutter.embedding.android.SplashScreenDrawable"
            android:resource="@drawable/launch_background"
            />
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>

        <intent-filter>
            <action android:name="FLUTTER_NOTIFICATION_CLICK" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>

    </activity>

    <provider
        android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
        android:exported="false"
        android:authorities="${applicationId}.flutter_downloader.provider"
        android:grantUriPermissions="true">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/provider_paths"/>
    </provider>

    <!-- Google Maps API KEY -->
    <!--       <meta-data-->
    <!--           android:name="com.google.android.geo.API_KEY"-->
    <!--           android:value="AIzaSyCHZlts47h-ZLLIgBK7D0m8LLzCNA4xkmY" />-->

    <meta-data
        android:name="com.google.firebase.messaging.default_notification_channel_id"
        android:value="high_importance_channel" />

    <!-- Don't delete the meta-data below.
         This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
    <meta-data
        android:name="flutterEmbedding"
        android:value="2" />


    <service
        android:name=".com.transistorsoft.locationmanager.service.TrackingService"
        android:enabled="true"
        android:exported="false"
        android:foregroundServiceType="location">
        <!-- Additional service settings here -->
    </service>

    <service
        android:name=".com.transistorsoft.locationmanager.service.LocationRequestService"
        android:enabled="true"
        android:exported="false"
        android:foregroundServiceType="location">
        <!-- Additional service settings here -->
    </service>

</application>

#Location permission request code
await permission.Permission.locationAlways.request().isGranted ||
await permission.Permission.locationWhenInUse.request().isGranted ||
await permission.Permission.location.request().isGranted

Screenshots or video

Screenshots or video demonstration

[Upload media here]

Version

permission_handler: ^11.3.1

Flutter Doctor output

[✓] Flutter (Channel stable, 3.24.3, on macOS 14.5 23F79 darwin-arm64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.96.4)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!

@TimHoogstrate
Copy link
Contributor

Dear @mpriyanka2k,

It is hard to pinpoint the issue, but it has likely to do with how you are handling the output of the locations. Do you have seething like a stack trace?

Kind regards,

@TimHoogstrate TimHoogstrate self-assigned this Feb 26, 2025
@TimHoogstrate TimHoogstrate added the status: needs more info We need more information before we can continue work on this issue. label Feb 26, 2025
Copy link

Without additional information, we are unfortunately not able to resolve this issue. Therefore, we reluctantly closed this issue for now. If you run into this issue later, feel free to file a new issue with a reference to this issue. Add a description of detailed steps to reproduce, expected and current behaviour, logs and the output of 'flutter doctor -v'. Thanks for your contribution.

@github-actions github-actions bot added the status: closed (missing info) Indicates the issue was automatically closed due to a lack of information. label Mar 12, 2025
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: closed (missing info) Indicates the issue was automatically closed due to a lack of information. status: needs more info We need more information before we can continue work on this issue.
Projects
None yet
Development

No branches or pull requests

2 participants