To report a bug and help us to provide the solution as fast as possible, please follow the instructions below:
1 - Describe the bug
From Firebase crashlytics.
Fatal Exception: java.lang.RuntimeException: Unable to instantiate service me.carda.awesome_notifications.core.managers.StatusBarManager: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2862)
at android.app.ActivityThread.-wrap4(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1427)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5421)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
at android.content.ContextWrapper.getPackageName(ContextWrapper.java:133)
at me.carda.awesome_notifications.core.AwesomeNotifications.getPackageName(AwesomeNotifications.java:90)
at me.carda.awesome_notifications.core.managers.StatusBarManager.<init>(StatusBarManager.java:54)
at java.lang.Class.newInstance(Class.java)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2859)
at android.app.ActivityThread.-wrap4(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1427)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5421)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
2 - Provide us as much information as possible
To help us to understand your issue, provide with your bug report all the relevant informations, such as:
Your plugins list inside the file pubspec.yaml (at least all notification plugins)
How are you creating the notification
Crash is on startup with the init code.
The output of flutter doctor command
[√] Flutter (Channel stable, 3.16.5, on Microsoft Windows [Version 10.0.22631.2861], locale en-NL)
• Flutter version 3.16.5 on channel stable at c:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 78666c8dc5 (9 days ago), 2023-12-19 16:14:14 -0800
• Engine revision 3f3e560236
• Dart version 3.2.3
• DevTools version 2.28.4
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at C:\Users\PeperMarkreel\AppData\Local\Android\sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.6)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.7.34221.43
• Windows 10 SDK version 10.0.22621.0
Rules
To report a bug and help us to provide the solution as fast as possible, please follow the instructions below:
1 - Describe the bug
From Firebase crashlytics.
2 - Provide us as much information as possible
To help us to understand your issue, provide with your bug report all the relevant informations, such as:
pubspec.yaml
(at least all notification plugins)I have added to app\build.gradle to mitigate the sharedpreferences bug.
What platform did you found the issue Android
What devices did you found the issue Nexus 5X
How are you initializing the plugin
How are you creating the notification Crash is on startup with the init code.
The output of
flutter doctor
command[√] Flutter (Channel stable, 3.16.5, on Microsoft Windows [Version 10.0.22631.2861], locale en-NL) • Flutter version 3.16.5 on channel stable at c:\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 78666c8dc5 (9 days ago), 2023-12-19 16:14:14 -0800 • Engine revision 3f3e560236 • Dart version 3.2.3 • DevTools version 2.28.4
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at C:\Users\PeperMarkreel\AppData\Local\Android\sdk • Platform android-34, build-tools 34.0.0 • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314) • All Android licenses accepted.
[√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.6) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.7.34221.43 • Windows 10 SDK version 10.0.22621.0
[√] Android Studio (version 2023.1) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
[√] VS Code (version 1.85.1) • VS Code at C:\Users\PeperMarkreel\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.78.0
[√] Connected device (3 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.2861] • Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.130 • Edge (web) • edge • web-javascript • Microsoft Edge 120.0.2210.91
[√] Network resources • All expected network resources are available.
• No issues found!
3 - How To Reproduce the Error
I have no idea.