ryanheise / just_audio

Audio Player
1.03k stars 652 forks source link

application crash using just_audio_background #1056

Closed bruco1987 closed 1 year ago

bruco1987 commented 1 year ago

Which API doesn't behave as documented, and how does it misbehave? I am making an application in flutter and I need to play an audio file in the background...(more like I need the notification that the audio player creates). Until yesterday it was working perfectly. I would initialize just_audio_background, create the MediaItems as the official guide shows me, and when I would play the player the notification would appear correctly. Since today, however, on my oneplus 8t when the song is supposed to start, the app crashes

Minimal reproduction project "THE EXAMPLE"

To Reproduce (i.e. user steps, not code) Steps to reproduce the behavior:

  1. install the app on my device
  2. Click on play
  3. when the audio starts the application crashes
  4. See error

Error messages - from application bulding to error

Launching lib\main.dart on KB2003 in debug mode...
Running Gradle task 'assembleDebug'...
Building with Flutter multidex support enabled.
√  Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app-debug.apk...
Debug service listening on ws://127.0.0.1:63508/UoTSzUbF4JA=/ws
Syncing files to device KB2003...
I/Quality ( 8670): Skipped: false 1 cost 10.510563 refreshRate 8306430 bit true processName com.ryanheise.just_audio_example
D/VRI[AudioServiceActivity]( 8670):  debugCancelDraw  cancelDraw=false,count = 211,android.view.ViewRootImpl@f1c3e87
D/VRI[AudioServiceActivity]( 8670): registerCallbacksForSync syncBuffer=false
D/VRI[AudioServiceActivity]( 8670): Received frameCommittedCallback lastAttemptedDrawFrameNum=1 didProduceBuffer=true syncBuffer=false
W/Parcel  ( 8670): Expecting binder but got null!
D/VRI[AudioServiceActivity]( 8670): draw finished.
D/VRI[AudioServiceActivity]( 8670): onFocusEvent true
D/VRI[AudioServiceActivity]( 8670): send msg MSG_WINDOW_FOCUS_CHANGED with caller android.view.ViewRootImplExtImpl.markAndDumpWindowFocusChangeMsg:1026 android.view.ViewRootImpl.windowFocusChanged:9847 android.view.ViewRootImpl$WindowInputEventReceiver.onFocusEvent:9560 android.os.MessageQueue.nativePollOnce:-2 android.os.MessageQueue.next:349 android.os.Looper.loopOnce:186 android.os.Looper.loop:351 android.app.ActivityThread.main:8427 java.lang.reflect.Method.invoke:-2 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run:584 com.android.internal.os.ZygoteInit.main:1013 <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> 
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged true mUpcomingWindowFocus true mAdded true
I/ExoPlayerImpl( 8670): Init 149db5e [ExoPlayerLib/2.18.7] [OnePlus8T, KB2003, OnePlus, 33]
W/t_audio_example( 8670): Accessing hidden method Landroid/media/AudioTrack;->getLatency()I (unsupported, reflection, allowed)
D/AudioManagerExtImpl( 8670): getStreamVolume packageName=com.ryanheise.just_audio_example, index=30, streamType=3
D/TrafficStats( 8670): tagSocket(160) with statsTag=0xffffffff, statsUid=-1
D/OplusScrollToTopManager( 8670): com.ryanheise.just_audio_example/com.ryanheise.audioservice.AudioServiceActivity,This DecorView@36b5b1c[AudioServiceActivity] change focus to true
W/AudioCapabilities( 8670): Unsupported mime audio/ffmpeg
W/VideoCapabilities( 8670): Unsupported mime image/vnd.android.heic
W/VideoCapabilities( 8670): Unrecognized profile/level 0/3 for video/mpeg2
W/VideoCapabilities( 8670): Unrecognized profile/level 0/3 for video/mpeg2
W/VideoCapabilities( 8670): Unsupported mime video/ffmpeg
I/DMCodecAdapterFactory( 8670): Creating an asynchronous MediaCodec adapter for track type audio
D/MediaCodec( 8670): CreateByComponentName: name c2.android.mp3.decoder
D/CCodecBufferChannel( 8670): mBufferCountDebug=0 mIsUserLoad=1
D/OplusCCodec( 8670): OplusCCodec [169]: (0xb400007c391e2200)
W/libc    ( 8670): Access denied finding property "vendor.oplus.media.vpp.stutter"
D/ListServiceUtils( 8670): mListServiceUtils::init CallingPid 8670
D/ListServiceUtils( 8670): mListServiceUtils::init this 0xb400007cbf5e15c0
V/ListServiceUtils( 8670): checkInListByUid module:sr-osie-whitelist uid:11045 cost 203us return 0
V/ListServiceUtils( 8670): checkInListByUid start module:video-setsurface-error uid:11045  time 88687223839us
V/ListServiceUtils( 8670): checkInListByUid end module:video-setsurface-error uid:11045  time 88687223907us
D/ListServiceUtils( 8670): checkInListByUid module:video-setsurface-error uid:11045 cost 67us return 0
D/CCodecBufferChannel( 8670): mBufferCountDebug=0 mIsUserLoad=1
D/MediaCodec( 8670): [0xb400007c30e7d000] init: CCodec 0xb400007c391e2200, CCodecBufferChannel 0xb400007c36969018
D/MediaCodec( 8670): [0xb400007c30e7d000] setState: 1
D/CCodec  ( 8670): allocate(c2.android.mp3.decoder)
I/Codec2Client( 8670): Available Codec2 services: "software"
I/CCodec  ( 8670): Created component [c2.android.mp3.decoder]
D/CCodecBufferChannel( 8670): [0xb400007c36969018] setComponent: mName c2.android.mp3.decoder#851, mPipelineWatcher 0xb400007c36969480
D/CCodecBufferChannel( 8670): PipelineWatcher debug info [c2.android.mp3.decoder#851] enable=0
D/CCodecConfig( 8670): read media type: audio/mpeg
D/ReflectedParamUpdater( 8670): extent() != 1 for single value type: algo.buffers.max-count.values
D/ReflectedParamUpdater( 8670): extent() != 1 for single value type: output.subscribed-indices.values
D/ReflectedParamUpdater( 8670): extent() != 1 for single value type: input.buffers.allocator-ids.values
D/ReflectedParamUpdater( 8670): extent() != 1 for single value type: output.buffers.allocator-ids.values
D/ReflectedParamUpdater( 8670): extent() != 1 for single value type: algo.buffers.allocator-ids.values
D/ReflectedParamUpdater( 8670): extent() != 1 for single value type: output.buffers.pool-ids.values
D/ReflectedParamUpdater( 8670): extent() != 1 for single value type: algo.buffers.pool-ids.values
I/CCodecConfig( 8670): query failed after returning 7 values (BAD_INDEX)
D/CCodecConfig( 8670): c2 config diff is Dict {
D/CCodecConfig( 8670):   c2::u32 coded.bitrate.value = 64000
D/CCodecConfig( 8670):   c2::u32 input.buffers.max-size.value = 8192
D/CCodecConfig( 8670):   c2::u32 input.delay.value = 0
D/CCodecConfig( 8670):   string input.media-type.value = "audio/mpeg"
D/CCodecConfig( 8670):   string output.media-type.value = "audio/raw"
D/CCodecConfig( 8670):   c2::u32 raw.channel-count.value = 2
D/CCodecConfig( 8670):   c2::u32 raw.sample-rate.value = 44100
D/CCodecConfig( 8670): }
D/MediaCodec( 8670): [0xb400007c30e7d000] setState: 2
I/MediaCodec( 8670): MediaCodec will operate in async mode
I/MediaCodec( 8670): [0xb400007c30e7d000] [c2.android.mp3.decoder] configure, format : AMessage(what = 0x00000000) = {
I/MediaCodec( 8670):   string log-session-id = "WY9m3-1rU8JAkdM6"
I/MediaCodec( 8670):   int32_t sample-rate = 44100
I/MediaCodec( 8670):   string mime = "audio/mpeg"
I/MediaCodec( 8670):   int32_t channel-count = 2
I/MediaCodec( 8670):   int32_t priority = 0
I/MediaCodec( 8670):   int32_t max-output-channel-count = 99
I/MediaCodec( 8670):   int32_t max-input-size = 4096
I/MediaCodec( 8670): }
D/MediaCodec( 8670): flushMediametrics
D/MediaCodec( 8670): [0xb400007c30e7d000] setState: 3
D/OplusCCodec( 8670): [initiateConfigureComponent:L787] OplusFeedbackInfo  mFeedbackID:-5476376613348302336
V/ListServiceUtils( 8670): checkInListByUid module:sr-osie-whitelist uid:11045 cost 124us return 0
D/OplusCCodec( 8670): debug enabled , debugType :0
D/OplusCCodec( 8670): [configOplusVppTypeV2:L287] whitelist:sr-osie-whitelist
V/ListServiceUtils( 8670): checkInListByUid module:sr-osie-whitelist uid:11045 cost 75us return 0
D/OplusCCodec( 8670): [configOplusVppTypeV2:L305] value:  - 0
V/ListServiceUtils( 8670): checkInListByUid module:media-sched-boost uid:11045 cost 61us return 0
D/OplusMediaCodecUtils( 8670): getProcessName: pid=8670 name=[com.ryanheise.just_audio_example] success
D/OplusCCodec( 8670): configureInputDelay [897]: (0xb400007c391e2200)
D/CCodec  ( 8670): [c2.android.mp3.decoder] buffers are bound to CCodec for this session
D/CCodecConfig( 8670): no c2 equivalents for log-session-id
D/CCodecConfig( 8670): no c2 equivalents for tp-ux-tid
D/CCodecConfig( 8670): no c2 equivalents for flags
D/ReflectedParamUpdater( 8670): vendor.oplus.vpp.white.list.value found, but param #1107330561 isn't present to update
D/CCodecConfig( 8670): config failed => CORRUPTED
W/Codec2Client( 8670): query -- param skipped: index = 1107298332.
D/CCodec  ( 8670): client requested max input size 4096, which is smaller than what component recommended (8192); overriding with component recommendation.
W/CCodec  ( 8670): This behavior is subject to change. It is recommended that app developers double check whether the requested max input size is in reasonable range.
D/CCodec  ( 8670): encoding statistics level = 0
D/CCodec  ( 8670): setup formats input: AMessage(what = 0x00000000) = {
D/CCodec  ( 8670):   int32_t bitrate = 64000
D/CCodec  ( 8670):   int32_t channel-count = 2
D/CCodec  ( 8670):   int32_t max-input-size = 8192
D/CCodec  ( 8670):   string mime = "audio/mpeg"
D/CCodec  ( 8670):   int32_t sample-rate = 44100
D/CCodec  ( 8670): }
D/CCodec  ( 8670): setup formats output: AMessage(what = 0x00000000) = {
D/CCodec  ( 8670):   int32_t channel-count = 2
D/CCodec  ( 8670):   string mime = "audio/raw"
D/CCodec  ( 8670):   int32_t sample-rate = 44100
D/CCodec  ( 8670):   int32_t android._config-pcm-encoding = 2
D/CCodec  ( 8670): }
I/CCodecConfig( 8670): query failed after returning 7 values (BAD_INDEX)
D/MediaCodec( 8670): [0xb400007c30e7d000] setState: 4
D/MediaCodec( 8670): keep callback message for reclaim
D/MediaCodec( 8670): [0xb400007c30e7d000] setState: 5
W/Codec2Client( 8670): query -- param skipped: index = 1342179345.
W/Codec2Client( 8670): query -- param skipped: index = 2415921170.
D/C2Store ( 8670): Using ION
D/CCodecBufferChannel( 8670): [c2.android.mp3.decoder#851] Created input block pool with allocatorID 16 => poolID 17 - OK (0)
I/CCodecBufferChannel( 8670): [c2.android.mp3.decoder#851] Created output block pool with allocatorID 16 => poolID 545 - OK
D/CCodecBufferChannel( 8670): [c2.android.mp3.decoder#851] Configured output block pool ids 545 => OK
D/CCodecBufferChannel( 8670): [0xb400007c36969018] [c2.android.mp3.decoder#851] start: output->outputDelay 0, output->numSlots 4
D/CCodecBuffers( 8670): [c2.android.mp3.decoder#851:1D-Output.Impl[N]] converted 0 buffers to array mode of 4
D/CCodecBufferChannel( 8670): [c2.android.mp3.decoder#851] start: updating output delay 0
D/MediaCodec( 8670): [0xb400007c30e7d000] setState: 6
D/TrafficStats( 8670): tagSocket(140) with statsTag=0xffffffff, statsUid=-1
D/PipelineWatcher( 8670): [0xb400007c36969480] pipelineFull: too many frames in pipeline (4)
I/AudioTrack( 8670): set(): type=audio,case=1,attributes=1,content_type=1,usage=1,source=-1,flags=0x800
D/AudioTrackExtImpl( 8670): AudioTrackExtImpl init
D/ExtensionsLoader( 8670): createInstance(64bit) : createExtendedFactory
D/ExtensionsLoader( 8670): Opened libSchedAssistExtImpl.so
D/AudioTrack( 8670): set(): streamType -1, sampleRate 44100, format 0x1, channelMask 0x3, frameCount 14144, flags #0, notificationFrames 0, sessionId 9689, transferType 3, uid -1, pid -1
I/AudioTrack( 8670): set(): 0xb400007c3696ae00, Create AudioTrackThread, tid = 14840
V/ListServiceUtils( 8670): checkInListByUid module:control package:audioBoostEnable cost 461us return 1
V/ListServiceUtils( 8670): checkInListByUid start module:audio-boost-blacklist uid:11045  time 88688231232us
V/ListServiceUtils( 8670): checkInListByUid end module:audio-boost-blacklist uid:11045  time 88688231412us
D/ListServiceUtils( 8670): checkInListByUid module:audio-boost-blacklist uid:11045 cost 179us return 0
D/AudioTrackExtImpl( 8670): doSmoothBoost, set audioapp task boost, pid=8670, tid=14840, enable=1, ret=0
I/AudioTrack( 8670): createTrack_l(1254) on outputId(21) : 0xb400007c3696ae00, mCblk = 0x7d74300000,  mLatency = 400, mAfLatency = 80, frameCount = 14144, mSampleRate = 44100, mFlags = 0, mReqFrameCount = 14144, mNotificationFramesAct = 7072
V/ListServiceUtils( 8670): checkInListByUid module:control package:audioBoostEnable cost 55us return 1
V/ListServiceUtils( 8670): checkInListByUid start module:audio-boost-blacklist uid:11045  time 88688247473us
V/ListServiceUtils( 8670): checkInListByUid end module:audio-boost-blacklist uid:11045  time 88688247535us
D/ListServiceUtils( 8670): checkInListByUid module:audio-boost-blacklist uid:11045 cost 61us return 0
D/AudioTrackExtImpl( 8670): doSmoothBoost, set audioapp task boost, pid=8670, tid=14721, enable=1, ret=0
V/ListServiceUtils( 8670): checkInListByUid start module:change-futex-timeout uid:11045  time 88688247605us
V/ListServiceUtils( 8670): checkInListByUid end module:change-futex-timeout uid:11045  time 88688247720us
D/ListServiceUtils( 8670): checkInListByUid module:change-futex-timeout uid:11045 cost 114us return 0
D/AudioTrack( 8670): setVolume(1254) left 1.000 right 1.000 , callingPid 8670
D/PipelineWatcher( 8670): [0xb400007c36969480] pipelineFull: too many frames in pipeline (4)
D/PipelineWatcher( 8670): [0xb400007c36969480] pipelineFull: too many frames in pipeline (4)
D/CCodecBufferChannel( 8670): [c2.android.mp3.decoder#851] DEBUG: elapsed: mInputMetEos 4, hasPendingOutputsInClient 0, n=1 [in=0 pipeline=0 out=0]
D/PipelineWatcher( 8670): [0xb400007c36969480] elapsed: mFramesInPipeline 0, n 4
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged false mUpcomingWindowFocus true mAdded true
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged false mUpcomingWindowFocus true mAdded true
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged false mUpcomingWindowFocus true mAdded true
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged false mUpcomingWindowFocus true mAdded true
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged false mUpcomingWindowFocus true mAdded true
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged false mUpcomingWindowFocus true mAdded true
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged false mUpcomingWindowFocus true mAdded true
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged false mUpcomingWindowFocus true mAdded true
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged false mUpcomingWindowFocus true mAdded true
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged false mUpcomingWindowFocus true mAdded true
D/TrafficStats( 8670): tagSocket(193) with statsTag=0xffffffff, statsUid=-1
D/VRI[AudioServiceActivity]( 8670): onFocusEvent false
D/VRI[AudioServiceActivity]( 8670): send msg MSG_WINDOW_FOCUS_CHANGED with caller android.view.ViewRootImplExtImpl.markAndDumpWindowFocusChangeMsg:1026 android.view.ViewRootImpl.windowFocusChanged:9847 android.view.ViewRootImpl$WindowInputEventReceiver.onFocusEvent:9560 android.os.MessageQueue.nativePollOnce:-2 android.os.MessageQueue.next:349 android.os.Looper.loopOnce:186 android.os.Looper.loop:351 android.app.ActivityThread.main:8427 java.lang.reflect.Method.invoke:-2 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run:584 com.android.internal.os.ZygoteInit.main:1013 <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> 
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged true mUpcomingWindowFocus false mAdded true
D/OplusScrollToTopManager( 8670): com.ryanheise.just_audio_example/com.ryanheise.audioservice.AudioServiceActivity,This DecorView@36b5b1c[AudioServiceActivity] change focus to false
D/BufferPoolAccessor2.0( 8670): bufferpool2 0xb400007c391e2628 : 5(40960 size) total buffers - 0(0 size) used buffers - 15/20 (recycle/alloc) - 5/38 (fetch/transfer)
D/BufferPoolAccessor2.0( 8670): evictor expired: 1, evicted: 1
D/VRI[AudioServiceActivity]( 8670): onFocusEvent true
D/VRI[AudioServiceActivity]( 8670): send msg MSG_WINDOW_FOCUS_CHANGED with caller android.view.ViewRootImplExtImpl.markAndDumpWindowFocusChangeMsg:1026 android.view.ViewRootImpl.windowFocusChanged:9847 android.view.ViewRootImpl$WindowInputEventReceiver.onFocusEvent:9560 android.os.MessageQueue.nativePollOnce:-2 android.os.MessageQueue.next:349 android.os.Looper.loopOnce:186 android.os.Looper.loop:351 android.app.ActivityThread.main:8427 java.lang.reflect.Method.invoke:-2 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run:584 com.android.internal.os.ZygoteInit.main:1013 <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> 
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged true mUpcomingWindowFocus true mAdded true
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged false mUpcomingWindowFocus true mAdded true
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged false mUpcomingWindowFocus true mAdded true
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged false mUpcomingWindowFocus true mAdded true
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged false mUpcomingWindowFocus true mAdded true
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged false mUpcomingWindowFocus true mAdded true
D/OplusInputMethodManagerInternal( 8670): get inputMethodManager extension: com.android.internal.view.IInputMethodManager$Stub$Proxy@e5d7ff5
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged false mUpcomingWindowFocus true mAdded true
D/AudioTrack( 8670): start(1254): prior state:STATE_STOPPED output 21 stream 3 session 9689
V/ListServiceUtils( 8670): checkInListByUid module:control package:audioBoostEnable cost 223us return 1
V/ListServiceUtils( 8670): checkInListByUid start module:audio-boost-blacklist uid:11045  time 88695989992us
V/ListServiceUtils( 8670): checkInListByUid end module:audio-boost-blacklist uid:11045  time 88695990150us
D/ListServiceUtils( 8670): checkInListByUid module:audio-boost-blacklist uid:11045 cost 157us return 0
W/AidlConversion( 8670): aidl2legacy_AudioChannelLayout_audio_channel_mask_t: no legacy output audio_channel_mask_t found for AudioChannelLayout{layoutMask: 16}
D/VRI[AudioServiceActivity]( 8670): onFocusEvent false
D/VRI[AudioServiceActivity]( 8670): send msg MSG_WINDOW_FOCUS_CHANGED with caller android.view.ViewRootImplExtImpl.markAndDumpWindowFocusChangeMsg:1026 android.view.ViewRootImpl.windowFocusChanged:9847 android.view.ViewRootImpl$WindowInputEventReceiver.onFocusEvent:9560 android.os.MessageQueue.nativePollOnce:-2 android.os.MessageQueue.next:349 android.os.Looper.loopOnce:186 android.os.Looper.loop:351 android.app.ActivityThread.main:8427 java.lang.reflect.Method.invoke:-2 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run:584 com.android.internal.os.ZygoteInit.main:1013 <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> <bottom of call stack> 
D/VRI[AudioServiceActivity]( 8670): handleWindowFocusChanged mWindowFocusChanged true mUpcomingWindowFocus false mAdded true
D/AudioTrack( 8670): getTimestamp_l(1254): device stall time corrected using current time 88696112241425
D/AndroidRuntime( 8670): Shutting down VM
E/AndroidRuntime( 8670): FATAL EXCEPTION: main
E/AndroidRuntime( 8670): Process: com.ryanheise.just_audio_example, PID: 8670
E/AndroidRuntime( 8670): android.app.RemoteServiceException$BadForegroundServiceNotificationException: Bad notification(tag=null, id=1124) posted from package com.ryanheise.just_audio_example, crashing app(uid=11045, pid=8670): Couldn't inflate contentViewsjava.lang.IndexOutOfBoundsException: Index: 2, Size: 2
E/AndroidRuntime( 8670):    at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2148)
E/AndroidRuntime( 8670):    at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0)
E/AndroidRuntime( 8670):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2404)
E/AndroidRuntime( 8670):    at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime( 8670):    at android.os.Looper.loopOnce(Looper.java:240)
E/AndroidRuntime( 8670):    at android.os.Looper.loop(Looper.java:351)
E/AndroidRuntime( 8670):    at android.app.ActivityThread.main(ActivityThread.java:8427)
E/AndroidRuntime( 8670):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 8670):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
E/AndroidRuntime( 8670):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
I/Process ( 8670): Sending signal. PID: 8670 SIG: 9
Lost connection to device.

Expected behavior I would expect the audio playback notification to appear

Screenshots no screenshot

Desktop (please complete the following information):

Smartphone (please complete the following information):

Flutter SDK version

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.13.0, on Microsoft Windows [Versione 10.0.22621.1413], locale it-IT)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.5.5)
[√] Android Studio (version 2022.2)
[√] VS Code (version 1.82.0)
[√] Connected device (4 available)
[√] Network resources

• No issues found!

Additional context https://stackoverflow.com/questions/77004344/application-crash-using-just-audio-background

ryanheise commented 1 year ago

Can you try a dependency override with audio_service branch fix/oppo_android_13?

bruco1987 commented 1 year ago

Could you tell me how to do it? So I test it

bruco1987 commented 1 year ago

Could you tell me how to do it? So I test it

ryanheise commented 1 year ago

In your pubspec.yaml:

dependency_overrides:
  audio_service:
    git:
      url: https://github.com/ryanheise/audio_service.git
      path: audio_service
      ref: fix/oppo_android_13
bruco1987 commented 1 year ago

Ok perfect I'll try and let you know.

Inviato da Outlook per Androidhttps://aka.ms/AAb9ysg


From: ryanheise @.> Sent: Sunday, September 10, 2023 1:46:36 PM To: ryanheise/just_audio @.> Cc: bruco1987 @.>; Author @.> Subject: Re: [ryanheise/just_audio] application crash using just_audio_background (Issue #1056)

In your pubspec.yaml:

dependency_overrides: audio_service: git: url: https://github.com/ryanheise/audio_service.git path: audio_service ref: fix/oppo_android_13

— Reply to this email directly, view it on GitHubhttps://github.com/ryanheise/just_audio/issues/1056#issuecomment-1712792149, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD5U3DFL7OJE6HEN6RMZ2V3XZWSBZANCNFSM6AAAAAA4SC72XI. You are receiving this because you authored the thread.Message ID: @.***>

bruco1987 commented 1 year ago

p

Nel tuo pubspec.yaml:

dependency_overrides:
  audio_service:
    git:
      url: https://github.com/ryanheise/audio_service.git
      path: audio_service
      ref: fix/oppo_android_13

perfect now it works correctly... is this a temporary solution? will it be fixed with the next update or should I leave it on pubspec?

ryanheise commented 1 year ago

Well I'm not sure yet whether this is the right solution, and so maybe you could help me test a few more scenarios on the Oppo device to be sure.

First of all, what happens when you rebuild your app with targetSdkVersion 32 instead of 33? In the notification for older versions of Android, you should be able to switch between the expanded and compact view, where the expanded view has 4 buttons and the compact view has only 3 buttons. But this "fix" changes the logic a bit to avoid the Oppo incompatibility so I'd like to know if the compact view is still working.

If your own app doesn't have a playlist, you won't get all 4 buttons because there won't be a previous or next button, so if that's the case you'd need to test the official just_audio_background example and jump to one of the tracks in the middle of the playlist so that you definitely can see both the previous and next buttons, as well as 2 more buttons in the expanded view, or just 1 more in the compact view.

ryanheise commented 1 year ago

Actually, scratch that test since we really should be targeting at least 33. What I was really interested in testing was Oppo with an older version of Android (e.g. 12 or earlier) but that is not as easy to test unless you happen to have another Oppo phone with an older version of Android.

ryanheise commented 1 year ago

The fix mentioned above has now been published. You can change your pubspec back to how it was, but run flutter pub upgrade to ensure you are getting the latest update to the transitive dependency audio_service. Thanks for reporting the bug.

github-actions[bot] commented 11 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with just_audio.