-
Notifications
You must be signed in to change notification settings - Fork 664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with permission checker and android_alarm_manager #65
Comments
Hi, thanks for reporting. At a first glance the issue seems to come from I'm afraid that this can't be handled by |
Hi, yes android_alarm_manager is on android x. I will try and track down the issue as well. |
Could I also suggest removing the permission checking, or making it optional. I know it's convenient, but this package should not take on that responsibility in my opinion. |
It needs to check because it will ask for permission if you don’t have it already. That’s the only reason why. |
Hi no problem, just a thought. I found the cause to be similar to what happened here: flutter/plugins#1125. Adding the following check to registerWith fixed it: |
@lucien-theron is this fixed already? I saw that #156 is already closed. If so, feel free to close this as well. |
@miguelpruivo that was for another plugin having the same issue. They fixed it the same way I did in the above PR I made. So if you can merge that PR then we good to go. |
Right. As long as the iOS side is done as well it can be merged. Waiting for that. If you don't have experience with iOS/Obj-C I may look into it later. Thank you. |
Okay thanks, I think its an Android specific issue but you are welcome to look into it. Reason for issue was highlighted here: transistorsoft/flutter_background_fetch#22 (comment) |
Merged and published. Thank you for contributing. |
Hi,
I'm getting the following error when I have both file_picker and android_alarm_manager packages installed:
E/MethodChannel#file_picker( 3336): java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference E/MethodChannel#file_picker( 3336): at androidx.core.content.ContextCompat.checkSelfPermission(ContextCompat.java:544) E/MethodChannel#file_picker( 3336): at com.mr.flutter.plugin.filepicker.FilePickerPlugin.checkPermission(FilePickerPlugin.java:127) E/MethodChannel#file_picker( 3336): at com.mr.flutter.plugin.filepicker.FilePickerPlugin.startFileExplorer(FilePickerPlugin.java:169) E/MethodChannel#file_picker( 3336): at com.mr.flutter.plugin.filepicker.FilePickerPlugin.onMethodCall(FilePickerPlugin.java:119) E/MethodChannel#file_picker( 3336): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:201) E/MethodChannel#file_picker( 3336): at io.flutter.view.FlutterNativeView$PlatformMessageHandlerImpl.handleMessageFromDart(FlutterNativeView.java:188) E/MethodChannel#file_picker( 3336): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:202) E/MethodChannel#file_picker( 3336): at android.os.MessageQueue.nativePollOnce(Native Method) E/MethodChannel#file_picker( 3336): at android.os.MessageQueue.next(MessageQueue.java:325) E/MethodChannel#file_picker( 3336): at android.os.Looper.loop(Looper.java:142) E/MethodChannel#file_picker( 3336): at android.app.ActivityThread.main(ActivityThread.java:6541) E/MethodChannel#file_picker( 3336): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#file_picker( 3336): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) E/MethodChannel#file_picker( 3336): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
I replicated this in a clean project with the following in the pubspec.yaml:
android_alarm_manager: ^0.4.1+6
file_picker: ^1.3.3
Flutter doctor:
[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.17134.648], locale en-ZA) [√] Android toolchain - develop for Android devices (Android SDK version 28.0.3) [√] Android Studio (version 3.3) [√] Android Studio (version 3.0) [√] IntelliJ IDEA Community Edition (version 2018.3) [√] VS Code (version 1.32.3) [√] Connected device (2 available)
Thanks!
The text was updated successfully, but these errors were encountered: