permissions-dispatcher / PermissionsDispatcher

A declarative API to handle Android runtime permissions.
https://github.com/permissions-dispatcher/PermissionsDispatcher
Apache License 2.0
11.22k stars 1.44k forks source link

Add lint check for android.app.Fragment without v13 dependency #311

Closed hotchemi closed 6 years ago

hotchemi commented 7 years ago

https://github.com/hotchemi/PermissionsDispatcher/pull/306#issuecomment-298237438

mannodermaus commented 7 years ago

Some additional context:

We allow our users to exclude the support for "Native Fragments" (i.e. android.app.Fragment) included in PermissionsDispatcher. To do this, the Gradle dependency needs to have an exclude clause that skips the transitive dependency on support-v13.

If a user accidentally removes this transitive dependency, but still tries to use PermissionsDispatcher with an android.app.Fragment, their app will crash. To prevent this behavior, this Lint check was proposed. It should:

I'd say the severity of this Lint issue would be pretty high (at least an 8). In terms of the naming, how about something like MissingFragmentPermissionsDependency?

hotchemi commented 6 years ago

Happy closing 😇 ref: https://github.com/permissions-dispatcher/PermissionsDispatcher/issues/445