Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android sdk versions 5 & 6 video upload failure "Unfortunately, Camera has stopped" #205

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

benRivello
Copy link

Expected behavior

When taking video from camera intent started from filestack picker, upload happens normally

Observed behavior

Video is taken normally. Afterwards, dialog appears -> "Unfortunately, Camera has stopped": no file is available for upload.

8-12 13:21:55.634 32446-32446/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.sec.android.app.camera, PID: 32446
    java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2002, result=-1, data=Intent { act=inline-data dat=content://co.suitable.dev.fileprovider/movies/Android/data/co.suitable.dev/files/Movies/MP4_20190812_132136_1907016959.mp4 (has extras) }} to activity {com.sec.android.app.camera/com.sec.android.app.camera.Camcorder}: java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.
        at android.app.ActivityThread.deliverResults(ActivityThread.java:4058)
        at android.app.ActivityThread.handleSendResult(ActivityThread.java:4101)
        at android.app.ActivityThread.access$1400(ActivityThread.java:177)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1497)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:145)
        at android.app.ActivityThread.main(ActivityThread.java:5942)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
     Caused by: java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.
        at android.database.CursorWindow.nativeGetLong(Native Method)
        at android.database.CursorWindow.getLong(CursorWindow.java:524)
        at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:75)
        at android.database.CursorWrapper.getLong(CursorWrapper.java:106)
        at com.sec.android.app.camera.Camera.onActivityResult(Camera.java:6197)
        at android.app.Activity.dispatchActivityResult(Activity.java:6549)
        at android.app.ActivityThread.deliverResults(ActivityThread.java:4054)
        at android.app.ActivityThread.handleSendResult(ActivityThread.java:4101) 
        at android.app.ActivityThread.access$1400(ActivityThread.java:177) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1497) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:145) 
        at android.app.ActivityThread.main(ActivityThread.java:5942) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:372) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194) 

Fix

  • Change the way file uri is generated for sdk < 7
  • See more information here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants