10

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.

bogdy9912
  • 172
  • 1
  • 1
  • 10
  • you need to tell what you do when you get this error and what code you have that this error arise – aleksandrbel Nov 19 '16 at 20:39
  • http://stackoverflow.com/questions/28966496/android-studio-emulator-eglsurfaceattrib-not-implemented dont have enough rep to comment – Aaahh Nov 20 '16 at 00:30
  • Welcome to Stack Overflow! I've edited your question. You could perhaps improve it by reducing your code to the smallest amount of code to reproduce the error, but on the whole this is a decent question. – S.L. Barth is on codidact.com Nov 22 '16 at 19:50
  • I am seeing the same problem in emulator. In my case, I see this whenever the `BottomSheetDialog` is shown. Have you found a solution to this yet? – Yuchen Dec 06 '16 at 19:38
  • Possible duplicate of [Android Studio - Emulator - eglSurfaceAttrib not implemented](http://stackoverflow.com/questions/28966496/android-studio-emulator-eglsurfaceattrib-not-implemented) – Abhishek Aryan Jan 29 '17 at 05:44

2 Answers2

6

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. enter image description here.

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.

Community
  • 1
  • 1
Uddhav P. Gautam
  • 7,362
  • 3
  • 47
  • 64
1

I have also experienced a similar problem, I tried a simple sample app and it shows this error. In my case, I turned off android studio's instant run feature and it disappear. I don't know why but you can give a try.