2

Hi I'm dummy at android programming, then I got some problem with building app. I tried to build apps with this xml code: `

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.ebookfrenzy.androidsample.MainActivity">

    <EditText
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:inputType="textPersonName"
        android:text="@string/Namestring"
        android:ems="10"
        android:layout_above="@+id/button"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="28dp"
        android:id="@+id/editText" />

    <Button
        android:text="@string/PressMeString"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/button"
        android:layout_centerVertical="true"
        android:layout_centerHorizontal="true"
        android:textAllCaps="false" />
</RelativeLayout>

Then I got this error in ADV machine:

$ adb shell am start -n "com.ebookfrenzy.androidsample/com.ebookfrenzy.androidsample.AndroidSampleActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 2542 on device emulator-5554
I/art: Not late-enabling -Xcheck:jni (already on)
W/System: ClassLoader referenced unknown path: /data/app/com.ebookfrenzy.androidsample-1/lib/x86_64
I/InstantRun: Instant Run Runtime started. Android package is com.ebookfrenzy.androidsample, real application class is null.
W/System: ClassLoader referenced unknown path: /data/app/com.ebookfrenzy.androidsample-1/lib/x86_64
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true

                  [ 12-18 20:03:53.363  2542: 2542 D/         ]
                  HostConnection::get() New Host Connection established 0x7f710991c140, tid 2542


                  [ 12-18 20:03:53.377  2542: 2542 W/         ]
                  Process pipe failed

                  [ 12-18 20:03:53.502  2542: 2587 D/         ]
                  HostConnection::get() New Host Connection established 0x7f710991b3c0, tid 2587
I/OpenGLRenderer: Initialized EGL, version 1.4
E/EGL_emulation: tid 2587: eglSurfaceAttrib(1165): error 0x3009 (EGL_BAD_MATCH)
W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7f710139e400, error=EGL_BAD_MATCH

Some answers in it says "Try to set Randering to "Harware Randering", But it does not work and receive same error messages. How can I fix it?

장민엽
  • 23
  • 1
  • 1
  • 4
  • 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:46

1 Answers1

0

Why this happens? I found the following:

EGL_BAD_MATCH is generated if attribute is EGL_SWAP_BEHAVIOR, value is EGL_BUFFER_PRESERVED, and the EGL_SURFACE_TYPE attribute of the EGLConfig used to create surface does not contain EGL_SWAP_BEHAVIOR_PRESERVED_BIT.

Reference: eglSurfaceAttrib The khronos group is a non-profit organisation that provides a standard OpenGL interface.

How do you solve this? In your Android Emulator you can use the Built-in (Hardware) Graphics Card. I hope this helps.

user2922935
  • 439
  • 4
  • 12