glide
glide copied to clipboard
Gradle lint error due to POST_NOTIFICATIONS permission required starting Android 13
4.13.2:
Running ./gradlew lint is failing due to missing permission in Glide. By the way why do Glide need to use Notification?
Glide load line / GlideModule (if any) / list Adapter code (if any):
Fetching images
Layout XML:
N/A
Stack trace / LogCat:
> Task :app:libs:AndroidFirebase:lintDebug FAILED
C:\Users\jense\.gradle\caches\transforms-3\72c1d08f8d878ae1ba2736907b26e15a\transformed\jetified-glide-4.13.2\jars\classes.jar: Error: When targeting Android 13 or higher, posting a pe
rmission requires holding the POST_NOTIFICATIONS permission (usage from com.bumptech.glide.request.target.NotificationTarget) [NotificationPermission]
Explanation for issues of type "NotificationPermission":
When targeting Android 13 and higher, posting permissions requires holding
the runtime permission android.permission.POST_NOTIFICATIONS.
1 errors, 0 warnings
Any solution for this? Thanks
NotificationTarget was a contribution that lets you add images to notifications. Neither it nor the permission are used unless you use that class.
There's a bunch of information on suppressing lint here: https://developer.android.com/studio/write/lint#config.
We could just suppress the warning for that class, it's probably not providing much value since it's only used if the caller is using notifications anyway.
Hmm I also can't reproduce this when I build Glide or Glide's sample apps with target and compile sdk set to 33.
Hmm I also can't reproduce this when I build Glide or Glide's sample apps with target and compile sdk set to 33.
I think the version of AGP and Gradle is also a factor to reproduce it
Duplicate of #4940