0

I noticed in my crash reporter I had several crashes on some devices with stack trace:

Fatal Exception: java.lang.RuntimeException: takePicture failed, error=-38
   at android.hardware.Camera.native_takePicture(Camera.java)
   at android.hardware.Camera.takePicture(Camera.java:1728)
   at android.hardware.Camera.takePicture(Camera.java:1661)

I know this is a common error and it can have many causes but it's one of the first time I have an error number. Where can I find a list of these error numbers and their meaning?

guillaume-tgl
  • 2,749
  • 3
  • 23
  • 30

2 Answers2

2

There can be many reasons for this in my case i was trying to take photo without preview (hidden photo) and i was using SurfaceView, So i replaced it with

SurfaceTexture surfaceTexture = new SurfaceTexture(10);
camera.setPreviewTexture(surfaceTexture);

and the problem was solved... P.S I was getting this error only on Above 6.0 devices

Tabish
  • 390
  • 3
  • 12
0

I just found a list of errors in the file Camera.java:

private static final int NO_ERROR = 0;
private static final int EACCESS = -13;
private static final int ENODEV = -19;
private static final int EBUSY = -16;
private static final int EINVAL = -22;
private static final int ENOSYS = -38;
private static final int EUSERS = -87;
private static final int EOPNOTSUPP = -95;

This post is also related to my question: MediaRecorder start error codes

Not very useful though..

Community
  • 1
  • 1
guillaume-tgl
  • 2,749
  • 3
  • 23
  • 30