" java.lang.IllegalArgumentException:如果没有的configs匹配configSpec"当打开相机意向 [英] " java.lang.IllegalArgumentException: No configs match configSpec " While opening Camera Intent

查看:168
本文介绍了" java.lang.IllegalArgumentException:如果没有的configs匹配configSpec"当打开相机意向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我简单的摄像头意图演示中,我只有一个活动......

This is my simple Camera Intent Demo in which i have only one Activity .....

package x.y;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.widget.ImageView;
public class PhotoShoot extends Activity {
    final static int CAMERA_RESULT = 0;
    ImageView imv;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
        startActivityForResult(i, CAMERA_RESULT);
    }
    protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
        super.onActivityResult(requestCode, resultCode, intent);
        if (resultCode == RESULT_OK)
        {
            Bundle extras = intent.getExtras();
            Bitmap bmp = (Bitmap) extras.get("data");
            imv = (ImageView) findViewById(R.id.ReturnedImageView);
            imv.setImageBitmap(bmp);
        }
    }
}

和布局的main.xml

And Layout main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <ImageView 
        android:id="@+id/ReturnedImageView"
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content">
    </ImageView>
</LinearLayout>

清单...

Manifest ...

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="x.y"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".PhotoShoot"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest> 

投掷强制关闭几秒钟的Andr​​oid模拟器2.2 启动相机意向的有以下异常后...

Throwing "Force close" after few seconds in Android emulator 2.2 from starting of Camera intent with following Exception ...

07-06 15:26:00.999: ERROR/AndroidRuntime(544): FATAL EXCEPTION: GLThread 11
07-06 15:26:00.999: ERROR/AndroidRuntime(544): java.lang.IllegalArgumentException: No configs match configSpec
07-06 15:26:00.999: ERROR/AndroidRuntime(544): at android.opengl.GLSurfaceView$BaseConfigChooser.chooseConfig(GLSurfaceView.java:760)
07-06 15:26:00.999: ERROR/AndroidRuntime(544): at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:916)
07-06 15:26:00.999: ERROR/AndroidRuntime(544): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1246)
07-06 15:26:00.999: ERROR/AndroidRuntime(544): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)

任何想法?

推荐答案

这其实是一个更大的问题的一部分,我希望通过张贴在这里,其他人谁也经历过这样的错误会读这个词条。我同样希望,如果有我的结论是不正确的,有人来提出了更明确的解释和/或解决方案。

This is actually part of a bigger issue, and I'm hoping that by posting here, others who have experienced this error will read this entry. I equally hope that, if any of my conclusions are incorrect, someone comes forth with a more definitive explanation and/or solution.

核心问题是OpenGL的支持。 2.2开始,Android的支持OpenGL ES 2.0,并开始在4.0.3,Android的模拟器支持OpenGL ES 2.0。 4.0.3之前的仿真器,使用OpenGL ES 2.0 code将无法正常工作。 [显然,相机ES 1.0切换到2.0的Andr​​oid 2.2的]

The core issue is OpenGL support. Beginning at 2.2, Android supports OpenGL ES 2.0, and beginning at 4.0.3, Android emulators support OpenGL ES 2.0. Code that uses OpenGL ES 2.0 will not work on emulators before 4.0.3. [Evidently, the camera switched from ES 1.0 to 2.0 at Android 2.2]

不过,这还不是全部!没有Android的文档我遇到一提的是,为了支持Open GL ES 2.0仿真,盒子里装的显卡芯片组和驱动程序必须支持OpenGL 2.0,以及的。因此,如果你在AVD启用GPU仿真,你仍然遇到此错误,请执行下列操作:

But that's not all! None of the Android docs I've encountered mention that, in order to support Open GL ES 2.0 emulation, your box's graphic card chipset and driver must support OpenGL 2.0 as well. Therefore, if you enable GPU Emulation on the AVD and you still encounter this error, do the following:

1)如果您想了解您的显卡的规格,并参观芯片组制造商的网站,以确定该芯片组的OpenGL 2.0兼容。如果不是,你S.O.L.必须坚持通过实际的Andr​​oid设备,而不是一个仿真器来调试。

1) Find out the specs on your graphic card and visit the chipset manufacturer's web site to determine if the chipset is OpenGL 2.0 compatible. If it isn't, you're S.O.L. and must stick to debugging through an actual Android device instead of an emulator.

2)确定您是否有最新的图形驱动程序的芯片组。通过微软获得的驱动程序(如果你使用的是Windows)通常不支持OpenGL,所以你想从制造商下载最新的驱动程序。

2) Determine if you have the latest graphics driver for the chipset. Drivers obtained through Microsoft (if you're using Windows) typically do not support OpenGL, so you want to download the latest driver from the manufacturer.

我希望这有助于。

这篇关于&QUOT; java.lang.IllegalArgumentException:如果没有的configs匹配configSpec&QUOT;当打开相机意向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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