我正在尝试开发一个颤振的警报应用程序。
我使用颤振本地通知来安排闹钟时间。并使用颤振工作管理器和颤振铃声播放器播放警报声音。
但是当我点击通知时应用程序崩溃了。
旁注:我还在应用程序的某些部分使用了 audio_service。我不确定应用程序崩溃的原因是什么。
这是日志。
W/MediaButtonReceiver( 1028): More than one BroadcastReceiver that handles android.intent.action.MEDIA_BUTTON was found, returning null.
W/MediaSessionCompat( 1028): Couldn't find a unique registered media button receiver in the given context.
I/flutter ( 1028): ====== Completed Play audio
I/flutter ( 1028): 00 : 00 : 00
I/WM-WorkerWrapper( 1028): Worker result SUCCESS for Work [ id=023f11b9-b4e3-4d10-bf2c-4ee6f38a1f9b, tags={ be.tramckrijte.workmanager.BackgroundWorker } ]
E/NotificationManager( 1028): notifyAsUser: tag=null, id=111, user=UserHandle{0}
V/InputMethodManager( 1028): Reporting focus gain, without startInput
D/AndroidRuntime( 1028): Shutting down VM
I/flutter ( 1028): Current state --------> AppLifecycleState.inactive
E/AndroidRuntime( 1028): FATAL EXCEPTION: main
E/AndroidRuntime( 1028): Process: com.safecoms.dhamma, PID: 1028
E/AndroidRuntime( 1028): java.lang.NullPointerException: Attempt to invoke virtual method 'void com.ryanheise.audioservice.AudioServicePlugin$AudioHandlerInterface.invokeMethod(java.lang.String, java.lang.Object)' on a null object reference
E/AndroidRuntime( 1028): at com.ryanheise.audioservice.AudioServicePlugin.sendNotificationClicked(AudioServicePlugin.java:351)
E/AndroidRuntime( 1028): at com.ryanheise.audioservice.AudioServicePlugin.lambda$registerOnNewIntentListener$0$AudioServicePlugin(AudioServicePlugin.java:342)
E/AndroidRuntime( 1028): at com.ryanheise.audioservice.-$$Lambda$AudioServicePlugin$uiefaBhwWpiC06lTJjqW1HAiQiw.onNewIntent(Unknown Source:2)
E/AndroidRuntime( 1028): at io.flutter.embedding.engine.FlutterEngineConnectionRegistry$FlutterEngineActivityPluginBinding.onNewIntent(FlutterEngineConnectionRegistry.java:766)
E/AndroidRuntime( 1028): at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.onNewIntent(FlutterEngineConnectionRegistry.java:439)
E/AndroidRuntime( 1028): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onNewIntent(FlutterActivityAndFragmentDelegate.java:719)
E/AndroidRuntime( 1028): at io.flutter.embedding.android.FlutterActivity.onNewIntent(FlutterActivity.java:660)
E/AndroidRuntime( 1028): at android.app.Instrumentation.callActivityOnNewIntent(Instrumentation.java:1313)
E/AndroidRuntime( 1028): at android.app.Instrumentation.callActivityOnNewIntent(Instrumentation.java:1325)
E/AndroidRuntime( 1028): at android.app.ActivityThread.deliverNewIntents(ActivityThread.java:3493)
E/AndroidRuntime( 1028): at android.app.ActivityThread.performNewIntents(ActivityThread.java:3508)
E/AndroidRuntime( 1028): at android.app.ActivityThread.handleNewIntent(ActivityThread.java:3524)
E/AndroidRuntime( 1028): at android.app.ActivityThread.-wrap15(Unknown Source:0)
E/AndroidRuntime( 1028): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2077)
E/AndroidRuntime( 1028): at android.os.Handler.dispatchMessage(Handler.java:108)
E/AndroidRuntime( 1028): at android.os.Looper.loop(Looper.java:166)
E/AndroidRuntime( 1028): at android.app.ActivityThread.main(ActivityThread.java:7529)
E/AndroidRuntime( 1028): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 1028): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
E/AndroidRuntime( 1028): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
I/Process ( 1028): Sending signal. PID: 1028 SIG: 9