Skip to content

[Bug]: Invalid notification (no valid small icon) #1656

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

Closed
3 of 8 tasks
Mojo1917 opened this issue Mar 11, 2025 · 2 comments
Closed
3 of 8 tasks

[Bug]: Invalid notification (no valid small icon) #1656

Mojo1917 opened this issue Mar 11, 2025 · 2 comments
Assignees
Labels
status: needs more info We need more information before we can continue work on this issue.

Comments

@Mojo1917
Copy link

Mojo1917 commented Mar 11, 2025

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Linux
  • macOS
  • Web
  • Windows

Steps to reproduce

I am using the following settings to obtain the device's location:

return AndroidSettings(
          accuracy: LocationAccuracy.best,
          distanceFilter: 2,
          intervalDuration: const Duration(seconds: 2),
          foregroundNotificationConfig: ForegroundNotificationConfig(
            notificationChannelName:
                localizations.userRecordingNotificationTitle,
            notificationText: localizations.userRecordingNotificationText,
            notificationTitle: localizations.userRecordingNotificationTitle,
            enableWakeLock: false,
            setOngoing: true,
            notificationIcon: const AndroidResource(
                name: "ic_notification", defType: "drawable"),
          ));
  • The ic_notification asset is a 96x96 PNG image with an alpha channel.
  • The asset is placed directly in the drawable folder.

I found this related issue #1258

Expected results

  • The notification should be displayed correctly without causing an exception.
  • On my Pixel 5 test device, the notification appears as expected, and the icon is visible.

Actual results

  • A crash is reported with the following error message: PlatformException(error, Invalid notification (no valid small icon): Notification(channel=geolocator_channel_01 shortcut=null contentView=null vibrate=null sound=null defaults=0 flags=ONGOING_EVENT color=0x00000000 vis=PRIVATE), null, null). Error thrown .
  • Based on the Crashlytics report, it appears that Geolocator is using the fused location provider
  • The issue has been reported on a Pixel 9 device.

Code sample

For code, please see above. I am not able to reproduce the crash on my devices.

Screenshots or video

No response

Version

13.0.2

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.29.1, on macOS 15.3.1 24D70 darwin-arm64, locale de-DE)
[✓] 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.3)
[✓] VS Code (version 1.98.0)
[✓] Connected device (4 available)
[✓] Network resources
@TimHoogstrate
Copy link
Contributor

Dear @Mojo1917,

Can you add your manifest content settings to this issue (like targetSDK and compileSDK)?

Kind regards,

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

I found a fix to the problem. Switching to android:launchMode="singleTask" from singletop in the manifest solved the problem for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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