apivideo / api.video-reactnative-live-stream

React Native RTMP live stream client. Made with ♥ by api.video
https://api.video
MIT License
181 stars 33 forks source link

[Bug]: LifecycleScope is not available #91

Open ThibaultBee opened 2 months ago

ThibaultBee commented 2 months ago

Version

v2.0.1

Which operating systems have you used?

Environment that reproduces the issue

Is it reproducible in the example application?

Yes

RTMP Server

All

Reproduction steps

No clear, waiting for more feedback and/or an example to reproduce it.

Expected result

No exception

Actual result

An exception is thrown: E FATAL EXCEPTION: pool-40-thread-1 Process: com.**, PID: 2574 java.lang.IllegalStateException: LifecycleScope is not available at io.github.thibaultbee.streampack.views.PreviewView.startPreviewIfReady(PreviewView.kt:272) at io.github.thibaultbee.streampack.views.PreviewView.startPreview(PreviewView.kt:245) at video.api.livestream.views.ApiVideoView.startPreview$livestream_release(ApiVideoView.kt:62) at video.api.livestream.ApiVideoLiveStream$startPreview$1.invoke(ApiVideoLiveStream.kt:373) at video.api.livestream.ApiVideoLiveStream$startPreview$1.invoke(ApiVideoLiveStream.kt:364) at video.api.reactnative.livestream.LiveStreamView$1$1.invoke(LiveStreamView.kt:75) at video.api.reactnative.livestream.LiveStreamView$1$1.invoke(LiveStreamView.kt:72) at video.api.reactnative.livestream.utils.permissions.SerialPermissionsManager$requestPermissions$request$1$1.invoke(SerialPermissionsManager.kt:38) at video.api.reactnative.livestream.utils.permissions.SerialPermissionsManager$requestPermissions$request$1$1.invoke(SerialPermissionsManager.kt:35) at video.api.reactnative.livestream.utils.permissions.PermissionsManager$requestPermissions$1.onAllGranted(PermissionsManager.kt:51) at video.api.reactnative.livestream.utils.permissions.PermissionsManager.requestPermissions(PermissionsManager.kt:76) at video.api.reactnative.livestream.utils.permissions.PermissionsManager.requestPermissions(PermissionsManager.kt:49) at video.api.reactnative.livestream.utils.permissions.SerialPermissionsManager.requestPermissions$lambda$1(SerialPermissionsManager.kt:35) at video.api.reactnative.livestream.utils.permissions.SerialPermissionsManager.$r8$lambda$dzig6asy22NzT_1QrKBawhgieas(Unknown Source:0) at video.api.reactnative.livestream.utils.permissions.SerialPermissionsManager$$ExternalSyntheticLambda1.run(Unknown Source:10) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) at java.lang.Thread.run(Thread.java:1012)

Additional context

See: https://github.com/apivideo/api.video-reactnative-live-stream/issues/81#issuecomment-2230992214 https://github.com/apivideo/api.video-reactnative-live-stream/issues/81#issuecomment-2328834599 Workaround: https://github.com/apivideo/api.video-reactnative-live-stream/issues/81#issuecomment-2331200824

Relevant logs output

No response

talhatsk commented 2 months ago

hi @ThibaultBee i have upgrade to 2.0.1 version and facing this crash, is there any way to overcome/avoid this crash programmatically?

ThibaultBee commented 2 months ago

I don't have any workaround. Have you tried this workaround https://github.com/apivideo/api.video-reactnative-live-stream/issues/81#issuecomment-2331200824?

Could provide a way to reproduce this crash? (a fork of the exampl, a code snippet,...)

adaerodriguez commented 1 month ago

I have the same issue. Any news?

Only for help, this is the error that I receive:

` [c.t.l.a.BackgroundGeolocation$w0 uncaughtException] ‼️ Uncaught Exception: LifecycleScope is not available {"activityRecognitionInterval":10000,"allowIdenticalLocations":false,"authorization":{},"autoSync":true,"autoSyncThreshold":0,"backgroundPermissionRationale":{"title":"Allow {applicationName} to access this device's location even when closed or not in use?","message":"[CHANGEME] This app collects location data for FEATURE X and FEATURE Y.","positiveAction":"Change to \"{backgroundPermissionOptionLabel}\"","negativeAction":""},"batchSync":false,"configUrl":"","debug":false,"deferTime":0,"desiredAccuracy":-1,"desiredOdometerAccuracy":100,"disableAutoSyncOnCellular":false,"disableElasticity":false,"disableLocationAuthorizationAlert":false,"disableMotionActivityUpdates":false,"disableProviderChangeRecord":false,"disableStopDetection":false,"distanceFilter":0,"elasticityMultiplier":1,"enableHeadless":false,"enableTimestampMeta":false,"extras":{},"fastestLocationUpdateInterval":5000,"foregroundService":true,"geofenceInitialTriggerEntry":true,"geofenceModeHighAccuracy":false,"geofenceProximityRadius":1000,"geofenceTemplate":"","headers":{},"headlessJobService":"com.transistorsoft.rnbackgroundgeolocation.HeadlessTask","heartbeatInterval":15,"httpRootProperty":"location","httpTimeout":60000,"isMoving":false,"locationAuthorizationRequest":"Always","locationTemplate":"","locationTimeout":60,"locationUpdateInterval":5000,"locationsOrderDirection":"ASC","logLevel":5,"logMaxDays":3,"maxBatchSize":-1,"maxDaysToPersist":1,"maxMonitoredGeofences":97,"maxRecordsToPersist":-1,"method":"POST","minimumActivityRecognitionConfidence":75,"motionTriggerDelay":0,"notification":{"layout":"","title":"XRF FC","text":" XRF.FieldCompanion is now tracking your position.","color":"","channelName":"TSLocationManager","channelId":"","smallIcon":"1.0","largeIcon":"","priority":-1,"sticky":false,"strings":{},"actions":[]},"params":{},"persist":true,"persistMode":2,"schedule":[],"scheduleUseAlarmManager":false,"speedJumpFilter":300,"startOnBoot":false,"stationaryRadius":5,"stopAfterElapsedMinutes":0,"stopOnStationary":false,"stopOnTerminate":true,"stopTimeout":5,"triggerActivities":"in_vehicle, on_bicycle, on_foot, running, walking","url":"","useSignificantChangesOnly":false,"enabled":true,"schedulerEnabled":false,"trackingMode":1,"odometer":0,"isFirstBoot":false,"didLaunchInBackground":false,"didDeviceReboot":false}

java.lang.IllegalStateException: LifecycleScope is not available at io.github.thibaultbee.streampack.views.PreviewView.startPreviewIfReady(PreviewView.kt:272) at io.github.thibaultbee.streampack.views.PreviewView.startPreview(PreviewView.kt:245) at video.api.livestream.views.ApiVideoView.startPreview$livestream_release(ApiVideoView.kt:62) at video.api.livestream.ApiVideoLiveStream$startPreview$1.invoke(ApiVideoLiveStream.kt:373) at video.api.livestream.ApiVideoLiveStream$startPreview$1.invoke(ApiVideoLiveStream.kt:364) at video.api.reactnative.livestream.LiveStreamView$1$1.invoke(LiveStreamView.kt:75) at video.api.reactnative.livestream.LiveStreamView$1$1.invoke(LiveStreamView.kt:72) at video.api.reactnative.livestream.utils.permissions.SerialPermissionsManager$requestPermissions$request$1$1.invoke(SerialPermissionsManager.kt:38) at video.api.reactnative.livestream.utils.permissions.SerialPermissionsManager$requestPermissions$request$1$1.invoke(SerialPermissionsManager.kt:35) at video.api.reactnative.livestream.utils.permissions.PermissionsManager$requestPermissions$1.onAllGranted(PermissionsManager.kt:51) at video.api.reactnative.livestream.utils.permissions.PermissionsManager.requestPermissions(PermissionsManager.kt:76 at video.api.reactnative.livestream.utils.permissions.PermissionsManager.requestPermissions(PermissionsManager.kt:49) at video.api.reactnative.livestream.utils.permissions.SerialPermissionsManager.requestPermissions$lambda$1(SerialPermissionsManager.kt:35)

2024-10-28 17:10:46.912 26281-27065 TSLocationManager com.xxxxxxxx.dev E at video.api.reactnative.livestream.utils.permissions.SerialPermissionsManager.$r8$lambda$dzig6asy22NzT_1QrKBawhgieas(Unknown Source:0) at video.api.reactnative.livestream.utils.permissions.SerialPermissionsManager$$ExternalSyntheticLambda1.run(Unknown Source:10) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012) `

ThibaultBee commented 3 weeks ago

Can anyone test on the main branch?

yarn add git@github.com:apivideo/api.video-reactnative-live-stream.git
dev-asfand commented 2 days ago

I have the same issue. Any news? Please