解决Android 2.2自带Camera不能在模拟器中运行的问题
转载自: http://hi.baidu.com/zhang_xin03/blog/item/ed2c325d1d69c14efbf2c003.html
logcat可以看到类似如下问题:
- 07-01 17:26:42.338: ERROR/AndroidRuntime(452): java.lang.IllegalArgumentException: No configs match configSpec ??07-01 17:26:42.338: ERROR/AndroidRuntime(452):????? at android.opengl.GLSurfaceView$BaseConfigChooser.chooseConfig(GLSurfaceView.java:760) ??07-01 17:26:42.338: ERROR/AndroidRuntime(452):????? at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:916) ??07-01 17:26:42.338: ERROR/AndroidRuntime(452):????? at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1246) ??07-01 17:26:42.338: ERROR/AndroidRuntime(452):????? at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116) ??07-01 17:26:42.688: WARN/ActivityManager(92):??? Force finishing activity com.android.camera/.Camera??
看样子是glsurfaceview出了问题
Google一把可以看到这个地方:http://stackoverflow.com/questions/2948809/emulators-camera-built-in-app-buggy-in-froyo-2-2 Emulator’s camera built-in app buggy in Froyo / 2.2?
里面也说是opengl的问题
找到/Camera/src/com/android/camera/ui/GLRootView.java这个文件
第177行改成??????? setEGLConfigChooser(5, 6, 5, 0, 0, 0);
然后再从模拟器里运行就可以了
当然,首先得把原来的卸载掉:
adb remount
adb shell rm /system/app/Camera.apk
adb uninstall com.android.camera
然后再从eclipse里面运行就行了