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 11: Plugin crashes #29

Open
WIStudent opened this issue Sep 14, 2020 · 6 comments
Open

Android 11: Plugin crashes #29

WIStudent opened this issue Sep 14, 2020 · 6 comments

Comments

@WIStudent
Copy link

Trying to record a video results in a crash on Android 11 on my Pixel 3a

2020-09-14 10:59:41.941 27070-27176/app.prpl.dev V/Capacitor: callback: 11450130, pluginId: VideoRecorder, methodName: initialize, methodData: {"camera":1,"previewFrames":[{"id":"video-record","stackPosition":"back","width":"fill","height":"fill","x":0,"y":0,"borderRadius":0}]}
2020-09-14 10:59:41.965 27070-27139/app.prpl.dev I/CameraManagerGlobal: Connecting to camera service
2020-09-14 10:59:42.059 27070-27207/app.prpl.dev W/System.err: android.hardware.camera2.CameraAccessException: CAMERA_DISCONNECTED (2): checkPidStatus:2264: The camera device has been disconnected
2020-09-14 10:59:42.059 27070-27207/app.prpl.dev W/System.err:     at android.hardware.camera2.CameraManager.throwAsPublicException(CameraManager.java:1009)
2020-09-14 10:59:42.059 27070-27207/app.prpl.dev W/System.err:     at android.hardware.camera2.impl.ICameraDeviceUserWrapper.createDefaultRequest(ICameraDeviceUserWrapper.java:165)
2020-09-14 10:59:42.059 27070-27207/app.prpl.dev W/System.err:     at android.hardware.camera2.impl.CameraDeviceImpl.createCaptureRequest(CameraDeviceImpl.java:793)
2020-09-14 10:59:42.059 27070-27207/app.prpl.dev W/System.err:     at co.fitcom.fancycamera.Camera2.startPreview(Camera2.java:519)
2020-09-14 10:59:42.059 27070-27207/app.prpl.dev W/System.err:     at co.fitcom.fancycamera.Camera2.access$400(Camera2.java:66)
2020-09-14 10:59:42.059 27070-27207/app.prpl.dev W/System.err:     at co.fitcom.fancycamera.Camera2$2.onOpened(Camera2.java:257)
2020-09-14 10:59:42.059 27070-27207/app.prpl.dev W/System.err:     at android.hardware.camera2.impl.CameraDeviceImpl$1.run(CameraDeviceImpl.java:151)
2020-09-14 10:59:42.059 27070-27207/app.prpl.dev W/System.err:     at android.os.Handler.handleCallback(Handler.java:938)
2020-09-14 10:59:42.059 27070-27207/app.prpl.dev W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:99)
2020-09-14 10:59:42.060 27070-27207/app.prpl.dev W/System.err:     at android.os.Looper.loop(Looper.java:223)
2020-09-14 10:59:42.060 27070-27207/app.prpl.dev W/System.err:     at android.os.HandlerThread.run(HandlerThread.java:67)
2020-09-14 10:59:42.060 27070-27207/app.prpl.dev W/System.err: Caused by: android.os.ServiceSpecificException: checkPidStatus:2264: The camera device has been disconnected (code 4)
2020-09-14 10:59:42.060 27070-27207/app.prpl.dev W/System.err:     at android.os.Parcel.createExceptionOrNull(Parcel.java:2387)
2020-09-14 10:59:42.060 27070-27207/app.prpl.dev W/System.err:     at android.os.Parcel.createException(Parcel.java:2357)
2020-09-14 10:59:42.060 27070-27207/app.prpl.dev W/System.err:     at android.os.Parcel.readException(Parcel.java:2340)
2020-09-14 10:59:42.060 27070-27207/app.prpl.dev W/System.err:     at android.os.Parcel.readException(Parcel.java:2282)
2020-09-14 10:59:42.060 27070-27207/app.prpl.dev W/System.err:     at android.hardware.camera2.ICameraDeviceUser$Stub$Proxy.createDefaultRequest(ICameraDeviceUser.java:976)
2020-09-14 10:59:42.060 27070-27207/app.prpl.dev W/System.err:     at android.hardware.camera2.impl.ICameraDeviceUserWrapper.createDefaultRequest(ICameraDeviceUserWrapper.java:163)
2020-09-14 10:59:42.060 27070-27207/app.prpl.dev W/System.err: 	... 9 more
2020-09-14 10:59:42.102 27070-27207/app.prpl.dev E/MediaRecorder: start failed: -1004
2020-09-14 10:59:42.103 27070-27207/app.prpl.dev E/AndroidRuntime: FATAL EXCEPTION: CameraThread
    Process: app.prpl.dev, PID: 27070
    java.lang.RuntimeException: start failed.
        at android.media.MediaRecorder.start(Native Method)
        at co.fitcom.fancycamera.FancyCamera.initListener(FancyCamera.java:68)
        at co.fitcom.fancycamera.FancyCamera.access$000(FancyCamera.java:28)
        at co.fitcom.fancycamera.FancyCamera$1.onCameraOpen(FancyCamera.java:99)
        at co.fitcom.fancycamera.Camera2$2.onOpened(Camera2.java:260)
        at android.hardware.camera2.impl.CameraDeviceImpl$1.run(CameraDeviceImpl.java:151)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:223)
        at android.os.HandlerThread.run(HandlerThread.java:67)
@timmyrosen
Copy link

Having this same issue on my OnePlus 8 Pro running Android 11

@anandsathe67
Copy link

Similar Issue on Pixel 4A though the stack trace is a bit different. A permissions issue?? Adding the READ_PHONE_STATE permission to the manifest has no effect

--------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: CameraThread
java.lang.RuntimeException: start failed.
at android.media.MediaRecorder.start(Native Method)
at co.fitcom.fancycamera.FancyCamera.initListener(FancyCamera.java:68)
at co.fitcom.fancycamera.FancyCamera.access$000(FancyCamera.java:28)
at co.fitcom.fancycamera.FancyCamera$1.onCameraOpen(FancyCamera.java:99)
at co.fitcom.fancycamera.Camera2$2.onOpened(Camera2.java:260)
at android.hardware.camera2.impl.CameraDeviceImpl$1.run(CameraDeviceImpl.java:151)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.os.HandlerThread.run(HandlerThread.java:67)
E/UncaughtException: java.lang.RuntimeException: start failed.
at android.media.MediaRecorder.start(Native Method)
at co.fitcom.fancycamera.FancyCamera.initListener(FancyCamera.java:68)
at co.fitcom.fancycamera.FancyCamera.access$000(FancyCamera.java:28)
at co.fitcom.fancycamera.FancyCamera$1.onCameraOpen(FancyCamera.java:99)
at co.fitcom.fancycamera.Camera2$2.onOpened(Camera2.java:260)
at android.hardware.camera2.impl.CameraDeviceImpl$1.run(CameraDeviceImpl.java:151)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.os.HandlerThread.run(HandlerThread.java:67)
V/FA: Recording user engagement, ms: 548
E/FirebaseCrash: Failed to report uncaught exception
java.lang.SecurityException: getDataNetworkTypeForSubscriber
at android.os.Parcel.createExceptionOrNull(Parcel.java:2373)
at android.os.Parcel.createException(Parcel.java:2357)
at android.os.Parcel.readException(Parcel.java:2340)
at android.os.Parcel.readException(Parcel.java:2282)
at com.android.internal.telephony.ITelephony$Stub$Proxy.getNetworkTypeForSubscriber(ITelephony.java:8762)
at android.telephony.TelephonyManager.getNetworkType(TelephonyManager.java:3021)
at android.telephony.TelephonyManager.getNetworkType(TelephonyManager.java:2985)
at aqi.a(:com.google.android.gms.dynamite_dynamitemodulesc@[email protected] (040700-0):164)
at com.google.firebase.crash.internal.api.FirebaseCrashApiImpl.a(:com.google.android.gms.dynamite_dynamitemodulesc@[email protected] (040700-0):2)
at com.google.firebase.crash.internal.api.FirebaseCrashApiImpl.reportUncaughtException(:com.google.android.gms.dynamite_dynamitemodulesc@[email protected] (040700-0):2)
at apv.a(:com.google.android.gms.dynamite_dynamitemodulesc@[email protected] (040700-0):10)
at mi.onTransact(:com.google.android.gms.dynamite_dynamitemodulesc@[email protected] (040700-0):4)
at android.os.Binder.transact(Binder.java:1043)
at com.google.android.gms.internal.crash.zza.transactAndReadExceptionReturnVoid(Unknown Source:20)
at com.google.android.gms.internal.crash.zzn.zzb(Unknown Source:18)
at com.google.android.gms.internal.crash.zzg.zzd(Unknown Source:13)
at com.google.android.gms.internal.crash.zzc.run(Unknown Source:12)
at com.google.android.gms.internal.crash.zzg.run(Unknown Source:15)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
I/Process: Sending signal. PID: 5684 SIG: 9

@gbrits
Copy link

gbrits commented May 11, 2021

What a shame... having this same issue on Pixel 4 and looks like there's no solution for it?

@a-sola
Copy link

a-sola commented Aug 12, 2021

Having the same issue in my OnePlus Nord 2

@Franjoo
Copy link

Franjoo commented Jan 4, 2022

Same issue here :(

@anandsathe67
Copy link

@Franjoo if you are ok moving to Capacitor 3, this pull request I submitted (#41) seems to work ok

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

No branches or pull requests

6 participants