-
-
Notifications
You must be signed in to change notification settings - Fork 727
Description
Please check the following before submitting a new issue.
- I have searched the existing issues.
- I have carefully read the documentation and verified I have added the required platform specific configuration.
Please select affected platform(s)
- Android
- iOS
- Linux
- macOS
- Web
- Windows
Steps to reproduce
Upgrade to Flutter 3.29.3 and run ./gradlew build --no-daemon --info --stacktrace
I have added permission to manifest, but it seems, that the permission is needed to ask/verify at runtime.
I tried using compileSdk = 35//flutter.compileSdkVersion //NOTE proposed by geolocator plugin
as you mentioned in the docks but it didn't clear the error.
Moreover, the changelog has typo here https://pub.dev/packages/geolocator/changelog first itme should be 14.0.0 and not 5.0.0
Expected results
Code to build normally without errors about notification permission since the rest of the code is not using notifications
Actual results
baseflow/geolocator/location/BackgroundNotification.java:100: Error: Missing permissions required by NotificationManagerCompat.notify: android.permission.POST_NOTIFICATIONS [MissingPermission]
notificationManager.notify(notificationId, builder.build());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Explanation for issues of type "MissingPermission":
This check scans through your code and libraries and looks at the APIs
being used, and checks this against the set of permissions required to
access those APIs. If the code using those APIs is called at runtime, then
the program will crash.
Furthermore, for permissions that are revocable (with targetSdkVersion 23),
client code must also be prepared to handle the calls throwing an exception
if the user rejects the request for permission at runtime.
Code sample
Code sample
[
//this is causing the error in /BackgroundNotification.java:100:
if (notify) {
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
notificationManager.notify(notificationId, builder.build());
}
]
Screenshots or video
Screenshots or video demonstration
[Upload media here]
Version
14.0.0
Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel [user-branch], 3.29.3, on macOS 15.3.2 24D81 darwin-arm64, locale fi-FI)
! Flutter version 3.29.3 on channel [user-branch] at /Users/jussitamminen/development/flutter
Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
! Upstream repository unknown source is not a standard remote.
Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 16.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.3)
[✓] Connected device (4 available)
! Error: Browsing on the local area network for iPhone (Veera). Ensure the device is unlocked and attached with
a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
! Doctor found issues in 1 category.