flutter-permission-handler
flutter-permission-handler copied to clipboard
Add TargetApi annotation in PermissionUtils.java for Android
This adds the TargetApi annotation to the getManifestNames method in PermissionUtils.java. On Android, not including the TargetApi annotation to the getManifestNames method in PermissionUtils.java causes StrictMode errors: https://developer.android.com/reference/android/os/StrictMode.
List at least one fixed issue.
Pre-launch Checklist
- [x] I made sure the project builds.
- [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
- [x] I updated
pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is does not need version changes. - [x] I updated
CHANGELOG.mdto add a description of the change. - [x] I updated/added relevant documentation (doc comments with
///). - [x] I rebased onto
main. - [x] I added new tests to check the change I am making, or this PR does not need tests.
- [x] I made sure all existing and new tests are passing.
- [x] I ran
dart format .and committed any changes. - [x] I ran
flutter analyzeand fixed any errors.
Hi @victorsanni,
Can you elaborate why these changes are required? Both Android and iOS are building just fine at the moment and it seems that your changes break the build with the following error in CI:
Lexical or Preprocessor Issue (Xcode): 'strategies/AudioVideoPermissionStrategy.h' file not found
/Users/runner/work/flutter-permission-handler/flutter-permission-handler/permission_handler_apple/ios/Classes/PermissionManager.h:11:8
Parse Issue (Xcode): Could not build module 'permission_handler_apple'
/Users/runner/work/flutter-permission-handler/flutter-permission-handler/permission_handler_apple/example/ios/Runner/GeneratedPluginRegistrant.m:9:8
On Android, not including the TargetApi annotation to the getManifestNames method in PermissionUtils.java causes StrictMode errors: https://developer.android.com/reference/android/os/StrictMode
Same with the implicit fallthrough.
I have reverted the iOS import changes and will move the fallthrough comment to its own PR.