ConnectSDK / Connect-SDK-Android

Android source project for Connect SDK
Apache License 2.0
308 stars 129 forks source link

App crashes #376

Open elmira-asd opened 5 years ago

elmira-asd commented 5 years ago

Attempt to invoke virtual method 'buq bpd.a(com.google.android.gms.cast.MediaInfo, boc)' on a null object reference

should i check for currentCastSession at the first and if it wasn't null Or disconnected, then i call remoteMediaClient ?

val remoteMediaClient = castSession.remoteMediaClient

val mediaInfo = MediaInfo.Builder(selectedStation.stationMediaInfo.url) .setStreamType(MediaInfo.STREAM_TYPE_BUFFERED) .setContentType("audio/m3u") .setMetadata(metadata) .build()

val mediaLoadOptions = MediaLoadOptions.Builder().setAutoplay(true).build() remoteMediaClient.load(mediaInfo, mediaLoadOptions)

bhaveshdotstudio commented 1 year ago

2023-06-08 15:45:26.559 9831-9831 AndroidRuntime com.calkins.ksl D Shutting down VM

2023-06-08 15:45:26.560 9831-9831 AndroidRuntime com.calkins.ksl E FATAL EXCEPTION: main

Process: com.calkins.ksl, PID: 9831

java.lang.NullPointerException

at com.google.android.exoplayer2.util.Assertions.checkNotNull(Assertions.java:154)

at com.google.android.exoplayer2.ext.cast.DefaultMediaItemConverter.toMediaItem(DefaultMediaItemConverter.java:86)

at com.google.android.exoplayer2.ext.cast.CastTimelineTracker.getCastTimeline(CastTimelineTracker.java:129)

at com.google.android.exoplayer2.ext.cast.CastPlayer.updateTimeline(CastPlayer.java:982)

at com.google.android.exoplayer2.ext.cast.CastPlayer.updateTimelineAndNotifyIfChanged(CastPlayer.java:907)

at com.google.android.exoplayer2.ext.cast.CastPlayer.updateInternalStateAndNotifyIfChanged(CastPlayer.java:783)

at com.google.android.exoplayer2.ext.cast.CastPlayer.access$800(CastPlayer.java:81)

at com.google.android.exoplayer2.ext.cast.CastPlayer$StatusListener.onStatusUpdated(CastPlayer.java:1319)

at com.google.android.gms.cast.framework.media.zzbp.zzm(com.google.android.gms:play-services-cast-framework@@21.2.0:6)

at com.google.android.gms.cast.internal.zzas.zzaa(com.google.android.gms:play-services-cast@@21.2.0:1)

at com.google.android.gms.cast.internal.zzas.zzQ(com.google.android.gms:play-services-cast@@21.2.0:63)

at com.google.android.gms.cast.framework.media.RemoteMediaClient.onMessageReceived(com.google.android.gms:play-services-cast-framework@@21.2.0:1)

at com.google.android.gms.cast.zzbq.run(com.google.android.gms:play-services-cast@@21.2.0:4)

at android.os.Handler.handleCallback(Handler.java:942)

at android.os.Handler.dispatchMessage(Handler.java:99)

at android.os.Looper.loopOnce(Looper.java:226)

at android.os.Looper.loop(Looper.java:313)

at android.app.ActivityThread.main(ActivityThread.java:8757)

at java.lang.reflect.Method.invoke(Native Method)

at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)