为什么dafault相机不能Android模拟器的工作? [英] Why the dafault camera not working in android emulator?

查看:110
本文介绍了为什么dafault相机不能Android模拟器的工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我试图打开摄像头应用程序在模拟器defaultly发出,意外停止和logcat的节目

When I am trying to open the Camera app defaultly given at the emulator, it stops unexpectedly and the logcat shows

02-08 11:18:35.005: INFO/ActivityManager(83): Starting activity: Intent {act= android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp= com.android.camera/.Camera }
02-08 11:18:35.085: INFO/ActivityManager(83): Start proc com.android.camera for activity com.android.camera/.Camera: pid=580 uid=10006 gids={1006, 1015}
02-08 11:18:35.385: INFO/WindowManager(83): Setting rotation to 1, animFlags=1
02-08 11:18:35.395: INFO/ActivityManager(83): Config changed: { scale=1.0 imsi=310/260 loc=en_US touch=3 keys=2/1/2 nav=3/1 orien=2 layout=18 uiMode=17 seq=11}
02-08 11:18:35.845: DEBUG/CameraHardwareStub(34): initHeapLocked: preview size=320x240
02-08 11:18:35.895: DEBUG/Camera(580): app passed NULL surface
02-08 11:18:35.925: DEBUG/CameraHardwareStub(34): initHeapLocked: preview size=320x240
02-08 11:18:35.925: VERBOSE/camera(580): startPreview
02-08 11:18:36.005: INFO/ActivityManager(83): Displayed activity com.android.camera/.Camera: 932 ms    (total 932 ms)
02-08 11:18:36.375: DEBUG/qemud(38): fdhandler_accept_event: accepting on fd 10
02-08 11:18:36.375: DEBUG/qemud(38): created client 0x17fc8 listening on fd 15
02-08 11:18:36.375: DEBUG/qemud(38): client_fd_receive: attempting registration for service   'sensors'
02-08 11:18:36.375: DEBUG/qemud(38): client_fd_receive:    -> received channel id 11
02-08 11:18:36.450: DEBUG/qemud(38): client_registration: registration succeeded for client 11
02-08 11:18:36.495: DEBUG/qemud(38): fdhandler_event: disconnect on fd 15
02-08 11:18:36.995: DEBUG/dalvikvm(580): GC_EXTERNAL_ALLOC freed 1975 objects / 129904 bytes in 182ms
02-08 11:18:37.355: DEBUG/libEGL(580): egl.cfg not found, using default config
02-08 11:18:37.355: DEBUG/libEGL(580): loaded /system/lib/egl/libGLES_android.so
02-08 11:18:37.445: WARN/dalvikvm(580): threadid=9: thread exiting with uncaught exception (group=0x4001d800)
02-08 11:18:37.445: ERROR/AndroidRuntime(580): FATAL EXCEPTION: GLThread 11
02-08 11:18:37.445: ERROR/AndroidRuntime(580): java.lang.IllegalArgumentException: No configs match configSpec
02-08 11:18:37.445: ERROR/AndroidRuntime(580):     at android.opengl.GLSurfaceView$BaseConfigChooser.chooseConfig(GLSurfaceView.java:760)
02-08 11:18:37.445: ERROR/AndroidRuntime(580):     at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:916)
02-08 11:18:37.445: ERROR/AndroidRuntime(580):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1246)
02-08 11:18:37.445: ERROR/AndroidRuntime(580):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)
02-08 11:18:37.475: WARN/ActivityManager(83):   Force finishing activity com.android.camera/.Camera
02-08 11:18:37.515: VERBOSE/camera(580): stopPreview
02-08 11:18:37.755: DEBUG/dalvikvm(83): GC_EXPLICIT freed 2789 objects / 135064 bytes in 137ms
02-08 11:18:37.765: INFO/WindowManager(83): Setting rotation to 0, animFlags=1
02-08 11:18:37.839: INFO/ActivityManager(83): Config changed: { scale=1.0 imsi=310/260 loc=en_US touch=3 keys=2/1/2 nav=3/1 orien=1 layout=18 uiMode=17 seq=12}
02-08 11:18:38.045: WARN/ActivityManager(83): Activity pause timeout for HistoryRecord{44f5db08 com.android.camera/.Camera}
02-08 11:18:40.555: DEBUG/dalvikvm(83): GC_EXPLICIT freed 986 objects / 59472 bytes in 131ms
02-08 11:18:41.985: INFO/Process(580): Sending signal. PID: 580 SIG: 9
02-08 11:18:42.005: INFO/WindowManager(83): WIN DEATH: Window{44ed4e48 SurfaceView paused=false}
02-08 11:18:42.005: INFO/ActivityManager(83): Process com.android.camera (pid 580) has died.
02-08 11:18:42.005: INFO/WindowManager(83): WIN DEATH: Window{44ff9fd0    com.android.camera/com.android.camera.Camera paused=false}
02-08 11:18:42.015: INFO/WindowManager(83): WIN DEATH: Window{45003ef8 SurfaceView paused=false}
02-08 11:18:42.095: WARN/InputManagerService(83): Got RemoteException sending setActive(false) notification to pid 580 uid 10006
02-08 11:18:43.805: DEBUG/dalvikvm(260): GC_EXPLICIT freed 2114 objects / 96480 bytes in 146ms
02-08 11:18:48.623: WARN/ActivityManager(83): Activity destroy timeout for HistoryRecord{44f5db08 com.android.camera/.Camera}

我无法理解的错误抛出:IllegalArgumentException:没有CONFIGS匹配configSpec。我需要一些额外的配置,以打开摄像头,虽然我已经配置在模拟器中的SD卡。

I couldn't understand the error IllegalArgumentException : No configs matches configSpec. Do I need some extra configuration to open the camera, though I have already configure the SD Card in the emulator.

要找到解决方案,我看到了一些答案这个问题是,相机始终是这样的,所以我们不应该用这个。如果这是正确的话我应该怎么使用的下发展摄像头应用程序?

To find the solution I saw some answer for this question is that the camera always works like this, so we should not use this. If this is right then what should I use to develope the camera application?

推荐答案

请确保您已获准<使用许可权的android:NAME =android.permission.CAMERA/>
 <使用特征的android:NAME =android.hardware.camera/>
 <使用特征的android:NAME =android.hardware.camera.autofocus/>
在AndroidManifest.xml

make sure that you have given permission <uses-permission android:name="android.permission.CAMERA" /> <uses-feature android:name="android.hardware.camera" /> <uses-feature android:name="android.hardware.camera.autofocus" /> in AndroidManifest.xml

请检查该文件相机

希望这将帮助你。如果你满意这个答案。然后接受俺们。因此,这将是对所有有帮助的。

hope it will help you.if you are satisfied with this ans. then accept the ans. so that it will be helpful for all.

这篇关于为什么dafault相机不能Android模拟器的工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆