使用仿真器,当我尝试启动相机时遇到了这些错误: 我试图重建,重新启动和使用其他仿真器,但无法正常工作 如何解决? 在此先感谢
09-03 18:43:58.349 4435-4435/com.google.android.gms.samples.vision.face.facetracker E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.google.android.gms.samples.vision.face.facetracker, PID: 4435
java.lang.RuntimeException: Could not find requested camera.
at com.google.android.gms.vision.CameraSource.zzchq(Unknown Source)
at com.google.android.gms.vision.CameraSource.start(Unknown Source)
at com.google.android.gms.samples.vision.face.facetracker.ui.camera.CameraSourcePreview.startIfReady(CameraSourcePreview.java:86)
at com.google.android.gms.samples.vision.face.facetracker.ui.camera.CameraSourcePreview.access$100(CameraSourcePreview.java:31)
at com.google.android.gms.samples.vision.face.facetracker.ui.camera.CameraSourcePreview$SurfaceCallback.surfaceCreated(CameraSourcePreview.java:109)
at android.view.SurfaceView.updateWindow(SurfaceView.java:618)
at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:161)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2205)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6337)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:621)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
答案 0 :(得分:0)
您无法在模拟器上运行需要物理资源才能运行的应用程序,例如相机,传感器。要测试此类应用程序,您需要具有工作资源的真实设备。
仿真器只是具有Android OS真实映像的虚拟设备