hypeapps / Endoscope

Endoscope lets you to stream live video between android devices over Wi-Fi! 📱📲
GNU General Public License v3.0
683 stars 186 forks source link

Android 6 #6

Closed alhdo closed 8 years ago

alhdo commented 8 years ago

Endoscope keep crashing on android 6 with this error

FATAL EXCEPTION: Thread-7434 Process: pl.hypeapp.endoscope, PID: 13282 java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() at android.os.Handler.(Handler.java:200) at android.os.Handler.(Handler.java:114) at android.app.Dialog.(Dialog.java:130) at android.app.Dialog.(Dialog.java:180) at android.support.v7.app.AppCompatDialog.(AppCompatDialog.java:43) at android.support.v7.app.AlertDialog.(AlertDialog.java:95) at android.support.v7.app.AlertDialog$Builder.create(AlertDialog.java:927) at pl.hypeapp.endoscope.StartStreamActivity.logError(StartStreamActivity.java:224) at pl.hypeapp.endoscope.StartStreamActivity.onError(StartStreamActivity.java:168) at net.majorkernelpanic.streaming.rtsp.RtspServer.postError(RtspServer.java:300) at net.majorkernelpanic.streaming.rtsp.RtspServer$WorkerThread.run(RtspServer.java:410)

hypeapps commented 8 years ago

@alhdo Thank you. Can you describe when you got this error? Hmm I think it may be when RTSP server got error but i don't know why yet.

hypeapps commented 8 years ago

@alhdo Can you change this method: StartStreamActivity.onError(StartStreamActivity.java:168) @Override public void onError(RtspServer server, Exception e, int error) { logError(e.getMessage()); }

to

@Override public void onError(RtspServer server, Exception e, int error) { Log.e("RTSP ERROR", e.getMessage() + " " + error); }

Then read the Log in android studio

alhdo commented 8 years ago

@hypeapps I found this error when i m trying to stream or connect to a server.

08-08 13:30:10.841 17780-17780/pl.hypeapp.endoscope E/AndroidRuntime: FATAL EXCEPTION: main Process: pl.hypeapp.endoscope, PID: 17780 java.lang.RuntimeException: Fail to connect to camera service at android.hardware.Camera.<init>(Camera.java:568) at android.hardware.Camera.open(Camera.java:405) at com.google.zxing.client.android.camera.open.GingerbreadOpenCameraInterface.open(GingerbreadOpenCameraInterface.java:57) at com.google.zxing.client.android.camera.open.CameraManager.openDriver(CameraManager.java:77) at com.dlazaro66.qrcodereaderview.QRCodeReaderView.surfaceCreated(QRCodeReaderView.java:110) at android.view.SurfaceView.updateWindow(SurfaceView.java:712) at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:209) at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1014) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2511) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1438) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7398) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:920) at android.view.Choreographer.doCallbacks(Choreographer.java:695) at android.view.Choreographer.doFrame(Choreographer.java:631) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7224) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

I m getting this after your modification. I think it's may be a problem with permission

alhdo commented 8 years ago

When i try to act as server on android 6

08-08 14:41:09.881 23207-24241/pl.hypeapp.endoscope W/AutoFocusManager: Unexpected exception while focusing java.lang.RuntimeException: Camera is being used after Camera.release() was called at android.hardware.Camera.native_autoFocus(Native Method) at android.hardware.Camera.autoFocus(Camera.java:1323) at com.google.zxing.client.android.camera.open.AutoFocusManager.start(AutoFocusManager.java:72) at com.google.zxing.client.android.camera.open.AutoFocusManager$AutoFocusTask.doInBackground(AutoFocusManager.java:106) at android.os.AsyncTask$2.call(AsyncTask.java:292) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818)

ccoenen commented 8 years ago

Not sure if this is related: I was never asked for camera permission, and sure enough it was disabled (which is probably the default as of android 6). I had to go to Settings -> Apps -> Endoscope -> Permissions and enable the switch for "camera".

hypeapps commented 8 years ago

Update to version 1.3