错误"EGL_BAD_MATCH";在Android Studio模拟器中 [英] Error "EGL_BAD_MATCH" in Android Studio emulator

查看:234
本文介绍了错误"EGL_BAD_MATCH";在Android Studio模拟器中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,那是什么?

  E/EGL_emulation:tid 3912:eglSurfaceAttrib(1146):错误0x3009(EGL_BAD_MATCH) 

我应该怎么做才能解决该错误?

 公共类Main扩展AppCompatActivity {公共TextView得分;公共ImageView alergator1;公共ImageView alergator2;公共FrameLayout框架;public int scoreINT;公众持股量高;公共浮动框架公共浮动alergator1X;公众持股数公共浮动alergator2X;公共浮标alergator2Y;公共ImageView的错误处理;public int x;私有处理程序处理程序= new Handler();私有静态Timer timer = new Timer();@Override受保护的void onCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);分数=(TextView)findViewById(R.id.Score);alergator1 =(ImageView)findViewById(R.id.runner);alergator2 =(ImageView)findViewById(R.id.runner2);框架=(FrameLayout)findViewById(R.id.Frame);frame.post(new Runnable(){@Override公共无效run(){frameHigh = frame.getHeight();frameWidh = frame.getWidth();}});alergator1.post(new Runnable(){@Override公共无效run(){alergator1X = frameWidh/2;alergator1.setX(alergator1X);alergator1Y = frameHigh-250;alergator1.setY(alergator1Y);}});alergator2.post(new Runnable(){@Override公共无效run(){alergator2X = frameWidh/2;alergator2.setX(alergator2X);alergator2Y = frameHigh-250;alergator2.setY(alergator2Y);}});timer.schedule(new TimerTask(){@Override公共无效run(){handler.post(new Runnable(){@Override公共无效run(){x ++;如果(x%2 == 0){alergator1.setVisibility(View.INVISIBLE);alergator2.setVisibility(View.VISIBLE);} 别的 {alergator2.setVisibility(View.INVISIBLE);alergator1.setVisibility(View.VISIBLE);}}});}},0,900); 

这是代码,该应用程序可以正常运行,但是我想知道正在发生什么.也许我的代码很乱,但是我是一个初学者.

解决方案

EGL表示仿真图形库.Android移动设备操作系统使用EGL进行3D图形渲染.从Wiki获得有关EGL的更多知识:.

解决方案:哪种模式出了问题,只需更改为另一种模式即可解决.请注意,以软件仿真模式运行可能比设置的硬件仿真模式慢得多.在某些情况下,会抛出(显示)错误,但应用程序可以正常运行.在这种情况下,您可能希望忽略这些错误并享受出色的图形仿真.

I have one question, what is that?

E/EGL_emulation: tid 3912: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH)

what should I do to resolve that error?

public class Main extends AppCompatActivity {

public TextView score;
public ImageView alergator1;
public ImageView alergator2;
public FrameLayout frame;
public int scoreINT;
public float frameHigh;
public float frameWidh;
public float alergator1X;
public float alergator1Y;
public float alergator2X;
public float alergator2Y;
public ImageView miscare;
public int x;

private Handler handler = new Handler();
private static Timer timer = new Timer();



@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    score = (TextView) findViewById(R.id.Score);
    alergator1 = (ImageView) findViewById(R.id.runner);
    alergator2 = (ImageView) findViewById(R.id.runner2);
    frame = (FrameLayout) findViewById(R.id.Frame);


    frame.post(new Runnable() {
        @Override
        public void run() {
            frameHigh = frame.getHeight();
            frameWidh = frame.getWidth();
        }
    });

    alergator1.post(new Runnable() {
        @Override
        public void run() {
            alergator1X = frameWidh / 2;
            alergator1.setX(alergator1X);
            alergator1Y = frameHigh - 250;
            alergator1.setY(alergator1Y);
        }
    });


    alergator2.post(new Runnable() {
        @Override
        public void run() {
            alergator2X = frameWidh / 2;
            alergator2.setX(alergator2X);
            alergator2Y = frameHigh - 250;
            alergator2.setY(alergator2Y);
        }
    });


    timer.schedule(new TimerTask() {
        @Override
        public void run() {
            handler.post(new Runnable() {
                @Override
                public void run() {
                    x++;
                    if (x % 2 == 0) {
                        alergator1.setVisibility(View.INVISIBLE);
                        alergator2.setVisibility(View.VISIBLE);
                    } else {
                        alergator2.setVisibility(View.INVISIBLE);
                        alergator1.setVisibility(View.VISIBLE);

                    }

                }
            });

        }
    }, 0, 900);

That is the code, the app runs correctly, but I want to know what is happening. Maybe my code is disorderly, but I am a beginner.

解决方案

EGL means Emulated Graphics Library. The Android mobile device operating system uses EGL for 3D graphics rendering. Get more knowledge on EGL from wiki: https://en.wikipedia.org/wiki/EGL_(API)

When it says EGL_BAD_MATCH, your Emulated Graphics Library is which you/system selected is bad. There are two EGL modes as shown in below pic. .

Solution: Which mode is giving problem, just change to another mode, it should fix. Be aware that running in software emulation mode may run considerably slower than with hardware emulation mode set. There are cases where errors are thrown (shown) yet the app runs okay. If this is the case, you may want to ignore the errors and enjoy the superior graphics emulation.

这篇关于错误"EGL_BAD_MATCH";在Android Studio模拟器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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