question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NullPointerException at fluttersound (initMediaSession.BackgroundAudioService.java:565) [BUG]

See original GitHub issue

Flutter Sound Version :

  • Released or Beta version ? Released

  • Version number ? ^4.0.3+1

  • FULL or LITE flavor ? LITE i guess … to support android api 16 flutterFFmpegPackage = “audio-lts”


Severity

  • Crash

Platforms you faced the error

  • Android
  • Real device

Logs

(This is very important. Most of the time we cannot do anything if we do not have information on your bug)

Google Play crash report ( i have more for other phones request them if it will help you i will be happy to help)

34 minutes ago on app version 15 Huawei Y7 Prime 2019 (HWDUB-Q), 3072MB RAM, Android 8.1

java.lang.RuntimeException: 
  at android.app.ActivityThread.handleCreateService (ActivityThread.java:3976)
  at android.app.ActivityThread.-wrap5 (Unknown Source)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2109)
  at android.os.Handler.dispatchMessage (Handler.java:109)
  at android.os.Looper.loop (Looper.java:166)
  at android.app.ActivityThread.main (ActivityThread.java:7555)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:469)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:963)
Caused by: java.lang.NullPointerException: 
  at com.dooboolab.fluttersound.BackgroundAudioService.initMediaSession (BackgroundAudioService.java:565)
  at com.dooboolab.fluttersound.BackgroundAudioService.onCreate (BackgroundAudioService.java:474)
  at android.app.ActivityThread.handleCreateService (ActivityThread.java:3956)
  at android.app.ActivityThread.-wrap5 (Unknown Source)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2109)
  at android.os.Handler.dispatchMessage (Handler.java:109)
  at android.os.Looper.loop (Looper.java:166)
  at android.app.ActivityThread.main (ActivityThread.java:7555)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:469)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:963)


flutter doctor :

[√] Flutter (Channel stable, v1.12.13+hotfix.9, on Microsoft Windows [Version 10.0.18362.476], locale en-US)
    • Flutter version 1.12.13+hotfix.9 at C:\Android\flutter
    • Framework revision f139b11009 (5 weeks ago), 2020-03-30 13:57:30 -0700
    • Engine revision af51afceb8
    • Dart version 2.7.2

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Android\sdk\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • ANDROID_HOME = C:\Android\sdk\sdk\platform-tools
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[√] Android Studio (version 3.6)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[!] IntelliJ IDEA Community Edition (version 2019.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.2.1
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

[√] VS Code (version 1.37.1)
    • VS Code at C:\Users\Amr Abd Alkrim\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 2.25.1

[√] Connected device (1 available)
    • G8 • 1090308019017967 • android-arm64 • Android 9 (API 28)

! Doctor found issues in 2 categories.

flutter pub deps :

cupertino_icons: ^0.1.3
image_picker: ^0.6.6+1
intl: ^0.16.0
http: ^0.12.1
flutter_staggered_grid_view: ^0.3.0
shared_preferences: ^0.5.7
url_launcher: ^5.4.5
firebase_messaging: ^6.0.13
flutter_launcher_icons: ^0.7.5
location: ^3.0.2
audioplayers: ^0.15.1
timeago: ^2.0.26
flutter_multiselect: ^0.4.0
toast: ^0.1.5
searchable_dropdown: ^1.1.3
flutter_webview_plugin: ^0.3.11
vibration: ^1.2.4
flutter_gifimage: ^1.0.1
package_info: ^0.4.0+17
intro_views_flutter: ^2.8.1
devicelocale: ^0.2.3
universal_html: ^1.2.2
cached_network_image: ^2.2.0+1
photo_view: ^0.9.2
flutter_sound: ^4.0.3+1
share: ^0.6.4
app_review: ^1.1.0+1

Screenshots

(If applicable, add screenshots to help explain your problem). One of our customers sent this to us when he downloaded the app from play store (app link on google play)

photo_2020-05-06_00-35-23


Describe the bug Same Issue with me in version ^4.0.3+1 #317

8

Production Google Play crash reports i have more than 79 people impacted with this error

5

It started from 20-4-2020 when i added flutter sound plugin and uploaded an update to google paly

6

Almost all the devices are huawei with android 8 and 8.1

7

I don’t have a “Huawei Y7 Prime 2019 (HWDUB-Q), 3072MB RAM, Android 8.1” to test flutter run and give you the output. Is this information enough to know the bug?.. tell me if you need anything more

To Reproduce

  1. Download and run the app and it crashes in the installation from google play. The problem shows in some phones not all of them.

Expected behavior Don’t crash in production I only added this great and awesome plugin to record audio with the “FlutterSoundRecorder” module … I don’t need a background service to start when the app is installed

So make the service optional if its possible … Thanks for your hard work we really appreciate it

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
bsuttoncommented, May 7, 2020

I’ve pushed a possible fix for this in the 5.0 branch.

1reaction
Larpouxcommented, May 20, 2020

Sure 😃 If you still continue to have problems, please enter a new issue, (with your logs, of course, and the result of “flutter pub deps | grep flutter_sound” ). I really hope that everything fixed, now. Good luck 😃 !

Read more comments on GitHub >

github_iconTop Results From Across the Web

NullPointerException at fluttersound (initMediaSession. ...
I fixed a bug in 4.0.3 in the initMediaSession() procedure. I realize that it is not cool to crash in the TrackPlayer code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found