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

Created on 6 May 2020  Â·  12Comments  Â·  Source: Canardoux/tau

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

bug

Most helpful comment

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

All 12 comments

Looking to your logs, it seems that you use a Flutter Sound version prior to 4.0.3.
I understand that you are in production, but please could you check 4.0.4+1 ?

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 and you even do not need this feature. We really must find a way that TrackPlayer does not interfere when not needed.

@bsutton : did you work on this f**ing 'intent_service' ?
if yes, is it possible to backport your fixes in V4 ?

I'm pretty sure i was using ^4.0.3+1 .. I will try 4.0.4+1 and let you know but if it didn't work i will push an update without the background service in production for the sake of our customers. Then will try to help you with another way

Thanks. There is a problem with services. Probably the best for you is actually to remove the intent-filter in AndroidManifest.xml in your production App, until we find a good way to fix that.
Thank you again.

Sorry no. You were looking into it so I've not touched it.

I had a brief look but the stack trace didn't match the code based and it
looked like you had made some code changes.

On Wed, 6 May 2020, 7:32 pm Larpoux, notifications@github.com wrote:

@bsutton https://github.com/bsutton : did you work on this f**ing
'intent_service' ?
if yes, is it possible to backport your fixes in V4 ?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/dooboolab/flutter_sound/issues/340#issuecomment-624541657,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAG32OHTFNWN3FKMGU52DSTRQEVB3ANCNFSM4MZ63ISQ
.

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

Thanks. There is a problem with services. Probably the best for you is actually to remove the intent-filter in AndroidManifest.xml in your production App, until we find a good way to fix that.
Thank you again.

Hi I'm interesting in the workaround too could you elaborate what is exactly to remove? I didn't see any intent-filter related to Flutter Sound.

Thanks a bunch

@ShiroYacha : do you still have problems ?
(I was thinking that this issue was fixed).

If you still have issues, please enter a new issue, (with your logs, of course, and the result of "flutter pub deps | grep flutter_sound" ).

Should i upgrade to the latest version and test it @Larpoux ?

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 😃 !

@Larpoux I'll update the latest version and see if I still get this error.. it wasn't happening on most devices just a subset on androids... I'll monitor and raise a new issue if it occurs, thanks!

This bug is supposed to be fixed. Please re-open if the issue still occurs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

farrelanelca picture farrelanelca  Â·  5Comments

Larpoux picture Larpoux  Â·  4Comments

java-james picture java-james  Â·  3Comments

Denmal1982 picture Denmal1982  Â·  4Comments

TharinduNM picture TharinduNM  Â·  6Comments