[Nexus 6 Android Development] bobuck74:
Camera App Won't Open

Just flashed last night, finished restoring everything and tried to run the Camera App. This crashed with the following Logcat:

2019-12-03 13:03:46.933 752-914/? E/LightsService: Light requested not available on this device. 2
2019-12-03 13:03:47.957 12707-12814/? E/BugleRcsEngine: [4057] tgj.a: Cannot use CS.apk as it's battery optimized
2019-12-03 13:03:48.212 752-776/? E/LightsService: Light requested not available on this device. 2
2019-12-03 13:03:48.257 12951-12951/? E/android.camera: Not starting debugger since process cannot load the jdwp agent.
2019-12-03 13:03:48.661 12951-12951/? E/SoundPool: error loading /product/media/audio/ui/camera_click.ogg
2019-12-03 13:03:49.088 12951-12951/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.android.camera2, PID: 12951
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.camera2/com.android.camera.CameraActivity}: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2950)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3085)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1815)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6698)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:495)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:859)
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
at com.android.ex.camera2.portability.AndroidCameraAgentImpl$AndroidCameraDeviceInfo.getCharacteristics(AndroidCameraAgentImpl.java:176)
at com.android.camera.app.CameraController.getCharacteristics(CameraController.java:112)
at com.android.camera.CaptureModule.getFacingFromCameraId(CaptureModule.java:1542)
at com.android.camera.CaptureModule.init(CaptureModule.java:415)
at com.android.camera.CameraActivity.onCreateTasks(CameraActivity.java:1648)
at com.android.camera.util.QuickActivity.onCreate(QuickActivity.java:114)
at android.app.Activity.performCreate(Activity.java:7145)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2930)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3085)*
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)*
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)*
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)*
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1815)*
at android.os.Handler.dispatchMessage(Handler.java:106)*
at android.os.Looper.loop(Looper.java:193)*
at android.app.ActivityThread.main(ActivityThread.java:6698)*
at java.lang.reflect.Method.invoke(Native Method)*
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:495)*
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:859)*

Trying the Google Camera App, I also get an instant crash with this logcat:

2019-12-03 13:05:19.052 752-914/? E/LightsService: Light requested not available on this device. 2
2019-12-03 13:05:19.985 13061-13061/? E/id.GoogleCamer: Not starting debugger since process cannot load the jdwp agent.
2019-12-03 13:05:20.303 752-776/? E/LightsService: Light requested not available on this device. 2
2019-12-03 13:05:27.600 13061-13083/? E/CAM_CamDeviceVerify: Camera Manager reconnect failed, or there are no cameras on this device.
2019-12-03 13:05:27.627 13061-13061/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.google.android.GoogleCamera, PID: 13061
java.lang.IllegalStateException: No Cameras are currently available.
at com.android.camera.one.v2.OneCameraAppConfigModule.provideDefaultFeatureConfig$51666RRD5TGMSP3IDTKM8BR3C5MMASJ15THMURJ6D5JIUHRJCLP7CQB3CLPKGPBCE1IN4EQCCDNMQBR1DPI74RR9CGNM6OBDCLP62BR4CLR6IOR55T1M2RB5E9GK8PBMD5HMALJ5E9KMCQB5E8TKOORFDKNM2RJ4E9NMIP1FCDGMQPBIC4NNAT39DGNK2S3991IMOS35E8TKOORFDKNM2RJ4E9NMIP1FCDGMQPBIC4NM8PB2ELJIUT3IC5HMABQKE9GM6P9R55666RRD5TGMSP3IDTKM8BR3C5MMASJ15TNMSP9FEOP2UJRECL1M2RB5E9GKCPB1EHQN4PA3DTN6CQB77C______(OneCameraAppConfigModule.java:58)
at com.android.camera.one.v2.OneCameraAppConfigModule_ProvideDefaultFeatureConfigFactory.get(OneCameraAppConfigModule_ProvideDefaultFeatureConfigFactory.java:1041)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.android.camera.hdrplus.HdrPlusPrewarmBehavior_Factory.get(HdrPlusPrewarmBehavior_Factory.java:1033)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.android.camera.behavior.Behaviors$1.run(Behaviors.java:47)
at com.google.android.apps.camera.async.MainThreadThrowingExecutor$MainThreadThrowingRunnable.run(MainThreadThrowingExecutor.java:21)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
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:764)
at com.google.android.apps.camera.async.AndroidPriorityThread.run(AndroidPriorityThread.java:32)
2019-12-03 13:05:27.671 381-381/? E/lowmemorykiller: Error writing /proc/13061/oom_score_adj; errno=22
2019-12-03 13:05:27.746 752-914/? E/InputDispatcher: channel '2eaee25 com.google.android.GoogleCamera/com.android.camera.CameraLauncher (server)' ~ Channel is unrecoverably broken and will be disposed!
2019-12-03 13:05:28.195 12473-12523/? E/gf_ErrorReportUtil: Error trying to add app version info for com.google.android.webview
2019-12-03 13:05:31.836 2105-5529/? E/Uploader: Clearcut transport failed to make network request. Use 30099 milliseconds.
java.net.SocketTimeoutException: failed to connect to play.googleapis.com/216.58.197.10 (port 443) from /192.168.18.129 (port 39573) after 30000ms
at libcore.io.IoBridge.connectErrno(IoBridge.java:185)
at libcore.io.IoBridge.connect(IoBridge.java:129)
at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:137)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:390)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:230)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:212)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:436)
at java.net.Socket.connect(Socket.java:621)
at com.android.okhttp.internal.Platform.connectSocket(Platform.java:145)
at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:141)
at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:112)
at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:184)
at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126)
at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:281)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:461)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:258)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:26)
at acbz.a(:com.google.android.gms@19629024@19.6.29 (100300-278422107):34)
at acbz.execute(:com.google.android.gms@19629024@19.6.29 (100300-278422107):8)
at acbz.execute(:com.google.android.gms@19629024@19.6.29 (100300-278422107):7)
at rml.a(:com.google.android.gms@19629024@19.6.29 (100300-278422107):10)
at rml.a(:com.google.android.gms@19629024@19.6.29 (100300-278422107):32)
at rnb.a(:com.google.android.gms@19629024@19.6.29 (100300-278422107):156)
at com.google.android.gms.clearcut.uploader.QosUploaderChimeraService.a(:com.google.android.gms@19629024@19.6.29 (100300-278422107):72)
at com.google.android.gms.clearcut.uploader.QosUploaderChimeraService.a(:com.google.android.gms@19629024@19.6.29 (100300-278422107):2)
at aerg.b(:com.google.android.gms@19629024@19.6.29 (100300-278422107):13)
at aera.call(Unknown Source:4)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at sxr.b(:com.google.android.gms@19629024@19.6.29 (100300-278422107):15)
at sxr.run(:com.google.android.gms@19629024@19.6.29 (100300-278422107):10)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at tdp.run(Unknown Source:7)
at java.lang.Thread.run(Thread.java:764)

The key error seems to be

java.lang.IllegalStateException: No Cameras are currently available.

from the Google Camera App. If this is the case, then the

ArrayIndexOutOfBoundsException called in com.android.camera.CameraActivity.onCreateTasks(CameraActivity.java:1648)

would make sense as it would be an empty array. I'm not familiar enough with the Android kernel to help further than that, but I tried restarting and taking a look at the logcat with the filter "camera" and everything seemed normal, and indeed I no longer have this issue. So I suppose the conclusion is that anyone having this issue, try restarting your phone. If this occurs again, I'll follow up here.