Automattic / stories-android

Loop concept app - WP Stories library
GNU General Public License v2.0
20 stars 6 forks source link

Crash ISE: MediaRecorder: stop called in an invalid state: 8 #159

Open mzorz opened 5 years ago

mzorz commented 5 years ago

Motorola Moto e5 Play Android 8.1

If I try to save video, it starts, but after a few seconds it crashes with this:

2019-09-16 16:15:33.035 624-624/? D/SFPerfTracer:        layers: (5:11) (NavigationBar#0 (0xae79e000): 0:7418) (StatusBar#0 (0xae7a0000): 2:13597)* (RoundedOverlay#0 (0xae71e000): 0:736) (RoundedOverlay#1 (0xae713000): 0:731) (com.android.systemui.ImageWallpaper#0 (0xae78a000): 0:691)* (animation background stackId=1#0 (0xae739000): 0:59)* (DimLayerController/Stack=0#0 (0xae73b000): 0:741)* (Sprite#0 (0xae750000): 0:14)* (com.automattic.portkey/com.automattic.portkey.compose.ComposeLoopFrameActivity#0 (0xae709000): 115:243) (Toast#0 (0xae747000): 0:60)- (Toast#1 (0xae75a000): 37:64) 
2019-09-16 16:15:33.498 16873-16873/com.automattic.portkey E/MediaRecorder: stop called in an invalid state: 8
2019-09-16 16:15:33.503 16873-16873/com.automattic.portkey E/InputEventReceiver: Exception dispatching input event.
2019-09-16 16:15:33.503 16873-16873/com.automattic.portkey E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
2019-09-16 16:15:33.517 16873-16873/com.automattic.portkey E/MessageQueue-JNI: java.lang.IllegalStateException
        at android.media.MediaRecorder.stop(Native Method)
        at com.automattic.photoeditor.camera.Camera2BasicHandling.stopRecordingVideo(Camera2BasicHandling.kt:820)
        at com.automattic.photoeditor.state.BackgroundSurfaceManager.stopRecordingVideo(BackgroundSurfaceManager.kt:255)
        at com.automattic.portkey.compose.ComposeLoopFrameActivity.stopRecordingVideo(ComposeLoopFrameActivity.kt:624)
        at com.automattic.portkey.compose.ComposeLoopFrameActivity.access$stopRecordingVideo(ComposeLoopFrameActivity.kt:85)
        at com.automattic.portkey.compose.ComposeLoopFrameActivity$addClickListeners$1.onHoldingGestureEnd(ComposeLoopFrameActivity.kt:335)
        at com.automattic.portkey.compose.PressAndHoldGestureHelper.onTouch(PressAndHoldGestureHelper.kt:72)
        at android.view.View.dispatchTouchEvent(View.java:11775)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2993)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2971)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2971)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2971)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2971)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2971)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2971)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
        at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:477)
        at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1835)
        at android.app.Activity.dispatchTouchEvent(Activity.java:3326)
        at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
        at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:439)
        at android.view.View.dispatchPointerEvent(View.java:12018)
        at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4829)
        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4643)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4181)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4234)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4200)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4327)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4208)
        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4384)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4181)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4234)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4200)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4208)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4181)
        at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6744)
        at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6683)
        at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6644)
        at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6847)
        at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:193)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:325)
        at android.os.Looper.loop(Looper.java:142)
        at android.app.ActivityThread.main(ActivityThread.java:6647)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgs
2019-09-16 16:15:33.518 16873-16873/com.automattic.portkey D/AndroidRuntime: Shutting down VM
mzorz commented 4 years ago

Removing this one from the project since it was detected on our Camera2BasicHandler implementation (it calls the Camera2BasicHandling.stopRecordingVideo override), as can be seen here:

2019-09-16 16:15:33.517 16873-16873/com.automattic.portkey E/MessageQueue-JNI: java.lang.IllegalStateException
        at android.media.MediaRecorder.stop(Native Method)
        at com.automattic.photoeditor.camera.Camera2BasicHandling.stopRecordingVideo(Camera2BasicHandling.kt:820)
        at com.automattic.photoeditor.state.BackgroundSurfaceManager.stopRecordingVideo(BackgroundSurfaceManager.kt:255)
...

and we decided to move forward with CameraXBasicHandler which sits on top of the now actively developed CameraX library.

mzorz commented 4 years ago

cc @aforcier