Cannot check for permissions in background using background_fetch #269
Labels
status: closed (missing info)
Indicates the issue was automatically closed due to a lack of information.
status: needs more info
We need more information before we can continue work on this issue.
type: bug
Something isn't working
🔙 Regression
Plugin no longer works in the background.
Old (and correct) behavior
I was able to check for permissions in the background using background_fetch.
Current behavior
It crashes with this stack trace:
04-19 13:05:32.195 18500 18500 D permissions_handler: Activity cannot be null. 04-19 13:05:32.338 18500 19258 E flutter : [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(PermissionHandler.PermissionManager, Android activity is required to check for permissions and cannot be null., null) 04-19 13:05:32.338 18500 19258 E flutter : #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7) 04-19 13:05:32.338 18500 19258 E flutter : #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18) 04-19 13:05:32.338 18500 19258 E flutter : <asynchronous suspension> 04-19 13:05:32.338 18500 19258 E flutter : #2 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12) 04-19 13:05:32.338 18500 19258 E flutter : #3 MethodChannelPermissionHandler.checkPermissionStatus (package:permission_handler_platform_interface/src/method_channel/method_channel_permission_handler.dart:15:41) 04-19 13:05:32.338 18500 19258 E flutter : #4 PermissionActions.status (package:permission_handler/permission_handler.dart:25:51) 04-19 13:05:32.338 18500 19258 E flutter : #5 PermissionCheckShortcuts.isGranted (package:permission_handler/permission_handler.dart:54:33)
Reproduction steps
Use background_fetch plugin to generate a background fetch and check for permissions.
The app has to be force closed for the error to occur. Not just in the background. The activity needs to be null.
Configuration
Version:
4.4.0+hotfix.4 --> 5.0.0+hotfix.3
Platform:
The text was updated successfully, but these errors were encountered: