Skip to content
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

Can't open my app from background #25

Open
spacekestrel opened this issue Aug 7, 2021 · 0 comments
Open

Can't open my app from background #25

spacekestrel opened this issue Aug 7, 2021 · 0 comments

Comments

@spacekestrel
Copy link

I am trying to implement alarm clock, using alarm manager and this package, but it gives me this message, when i trying to launch app from background:

E/MethodChannel#com.pichillilorenzo/flutter_appavailability( 4567): Failed to handle method call
E/MethodChannel#com.pichillilorenzo/flutter_appavailability( 4567): java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.app.Activity.getApplicationContext()' on a null object reference
E/MethodChannel#com.pichillilorenzo/flutter_appavailability( 4567): 	at com.pichillilorenzo.flutter_appavailability.AppAvailability.getAppPackageInfo(AppAvailability.java:93)
E/MethodChannel#com.pichillilorenzo/flutter_appavailability( 4567): 	at com.pichillilorenzo.flutter_appavailability.AppAvailability.launchApp(AppAvailability.java:131)
E/MethodChannel#com.pichillilorenzo/flutter_appavailability( 4567): 	at com.pichillilorenzo.flutter_appavailability.AppAvailability.onMethodCall(AppAvailability.java:57)
E/MethodChannel#com.pichillilorenzo/flutter_appavailability( 4567): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/MethodChannel#com.pichillilorenzo/flutter_appavailability( 4567): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#com.pichillilorenzo/flutter_appavailability( 4567): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/MethodChannel#com.pichillilorenzo/flutter_appavailability( 4567): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#com.pichillilorenzo/flutter_appavailability( 4567): 	at android.os.MessageQueue.next(MessageQueue.java:335)
E/MethodChannel#com.pichillilorenzo/flutter_appavailability( 4567): 	at android.os.Looper.loop(Looper.java:183)
E/MethodChannel#com.pichillilorenzo/flutter_appavailability( 4567): 	at android.app.ActivityThread.main(ActivityThread.java:7656)
E/MethodChannel#com.pichillilorenzo/flutter_appavailability( 4567): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#com.pichillilorenzo/flutter_appavailability( 4567): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/MethodChannel#com.pichillilorenzo/flutter_appavailability( 4567): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/flutter ( 4567): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'android.content.Context android.app.Activity.getApplicationContext()' on a null object reference, null, java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.app.Activity.getApplicationContext()' on a null object reference
E/flutter ( 4567): 	at com.pichillilorenzo.flutter_appavailability.AppAvailability.getAppPackageInfo(AppAvailability.java:93)
E/flutter ( 4567): 	at com.pichillilorenzo.flutter_appavailability.AppAvailability.launchApp(AppAvailability.java:131)
E/flutter ( 4567): 	at com.pichillilorenzo.flutter_appavailability.AppAvailability.onMethodCall(AppAvailability.java:57)
E/flutter ( 4567): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/flutter ( 4567): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/flutter ( 4567): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/flutter ( 4567): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter ( 4567): 	at android.os.MessageQueue.next(MessageQueue.java:335)
E/flutter ( 4567): 	at android.os.Looper.loop(Looper.java:183)
E/flutter ( 4567): 	at android.app.ActivityThread.main(ActivityThread.java:7656)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant