api.video-reactnative-live-stream icon indicating copy to clipboard operation
api.video-reactnative-live-stream copied to clipboard

[Bug]: LifecycleScope is not available

Open ThibaultBee opened this issue 1 year ago • 3 comments

Version

v2.0.1

Which operating systems have you used?

  • [X] Android
  • [ ] iOS

Environment that reproduces the issue

  • Not relevant

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

ThibaultBee avatar Sep 11 '24 09:09 ThibaultBee

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

talhatsk avatar Sep 18 '24 07:09 talhatsk

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,...)

ThibaultBee avatar Sep 19 '24 15:09 ThibaultBee

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) `

adaerodriguez avatar Oct 25 '24 09:10 adaerodriguez

Can anyone test on the main branch?

yarn add [email protected]:apivideo/api.video-reactnative-live-stream.git

ThibaultBee avatar Oct 31 '24 16:10 ThibaultBee

I have the same issue. Any news? Please

dev-asfand avatar Nov 24 '24 13:11 dev-asfand

this is something related to re-renders, anyone got any solutions?

talhatsk avatar Dec 09 '24 13:12 talhatsk

Has anyone got a solution?

NeuDam avatar Dec 13 '24 15:12 NeuDam

I switched back to 2.0.0 and it fixed the LifeCycle bug but i'm not sure why we are getting this issue in 2.0.1

LynxSumit avatar Dec 25 '24 14:12 LynxSumit

Can anyone test on the main branch?

yarn add [email protected]:apivideo/api.video-reactnative-live-stream.git

There is a solution. Could someone test it?

ThibaultBee avatar Dec 26 '24 16:12 ThibaultBee

Can anyone test on the main branch?

yarn add [email protected]:apivideo/api.video-reactnative-live-stream.git

There is a solution. Could someone test it?

i'll check the main branch

talhatsk avatar Dec 26 '24 16:12 talhatsk

@ThibaultBee main branch works fine

talhatsk avatar Dec 26 '24 17:12 talhatsk

So, is this issue solved on the main branch?

ThibaultBee avatar Dec 27 '24 15:12 ThibaultBee

So, is this issue solved on the main branch?

yes seems like this issue is not in main branch

talhatsk avatar Dec 27 '24 16:12 talhatsk

is there any expected release for this fix? @ThibaultBee

talhatsk avatar Jan 01 '25 12:01 talhatsk

Hi. I have got the solution

if you are installing the latest version of the package 2.0.1 on below React native version 0.76.0 ... then you will get LifeCycle error.

I have upgraded ma RN version to 0.76.0 and its resolved

dev-asfand avatar Jan 01 '25 12:01 dev-asfand

Hi. I have got the solution

if you are installing the latest version of the package 2.0.1 on below React native version 0.76.0 ... then you will get LifeCycle error.

I have upgraded ma RN version to 0.76.0 and its resolved

i have checked by upgrading but it didn't work? is there any extra step?

talhatsk avatar Jan 02 '25 15:01 talhatsk

Same, I' upgraded to 0.76.6 but still got the same 'LifecycleScope' error

maurovisintin avatar Jan 16 '25 14:01 maurovisintin

I manually applied the changes on this commit https://github.com/apivideo/api.video-reactnative-live-stream/commit/00fceab1e34fe8145bbb50fe160913e12de5b923 and it worked

maurovisintin avatar Jan 16 '25 14:01 maurovisintin