Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why android emulator not working

Tags:

When I updated the Android Studio a few days ago, the Android Emulator stopped working. I tried to open a blank activity and the emulator did not work as well.

All the SDK tools have been installed and updated. Below are the event log and Logcat of a blank activity (Hello World!) when I run the blank activity.

Event Log: 1/1/2018 4:43 PM Gradle sync started

4:43 PM Project setup started

4:44 PM Gradle sync finished in 34s 677ms

4:44 PM Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar]

4:45 PM Gradle build finished in 1m 28s 392ms

5:00 PM Unable to run 'adb': null

5:00 PM 'C:\Media\platform-tools\adb.exe start-server' failed -- run manually if necessary

5:00 PM * daemon not running; starting now at tcp:5037

5:00 PM * daemon started successfully

5:03 PM Executing tasks: [:app:assembleDebug]

5:03 PM Emulator: emulator: ERROR: Missing initial data partition file: C:\Users\Android Studio.android\avd\Nexus_5_API_27.avd/userdata.img

5:03 PM Emulator: compileAndValidateCoreShader: fail to compile. infolog Fragment shader failed to compile with the following errors:

5:03 PM Emulator: ERROR: 0:85: error(#143) Undeclared identifier undefined

5:03 PM Emulator: ERROR: 0:85: error(#132) Syntax error: '<' parse error

5:03 PM Emulator: ERROR: error(#273) 2 compilation errors. No code generated

5:03 PM Emulator:

5:03 PM Emulator: linkAndValidateProgram: fail to link program. infolog: Fragment shader(s) were not successfully compiled before glLinkProgram() was called. Link failed.

5:03 PM Emulator:

Logcat: 
01-01 04:05:27.996 3188-3188/com.example.androidstudio.fixit I/zygote: Not late-enabling -Xcheck:jni (already on)
01-01 04:05:28.262 3188-3188/com.example.androidstudio.fixit W/zygote: Unexpected CPU variant for X86 using defaults: x86
01-01 04:05:28.565 3188-3201/com.example.androidstudio.fixit I/zygote: Debugger is no longer active
01-01 04:05:28.915 3188-3188/com.example.androidstudio.fixit I/InstantRun: starting instant run server: is main process
01-01 04:05:29.650 3188-3235/com.example.androidstudio.fixit D/OpenGLRenderer: HWUI GL Pipeline
01-01 04:05:29.872 3188-3235/com.example.androidstudio.fixit I/zygote: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
01-01 04:05:29.872 3188-3235/com.example.androidstudio.fixit I/OpenGLRenderer: Initialized EGL, version 1.4
01-01 04:05:29.872 3188-3235/com.example.androidstudio.fixit D/OpenGLRenderer: Swap behavior 1
01-01 04:05:29.873 3188-3235/com.example.androidstudio.fixit W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
01-01 04:05:29.873 3188-3235/com.example.androidstudio.fixit D/OpenGLRenderer: Swap behavior 0
01-01 04:05:30.001 3188-3235/com.example.androidstudio.fixit D/EGL_emulation: eglCreateContext: 0xa2b59da0: maj 2 min 0 rcv 2
01-01 04:05:30.073 3188-3235/com.example.androidstudio.fixit D/EGL_emulation: eglMakeCurrent: 0xa2b59da0: ver 2 0 (tinfo 0xac24c670)
01-01 04:05:30.269 3188-3235/com.example.androidstudio.fixit D/EGL_emulation: eglMakeCurrent: 0xa2b59da0: ver 2 0 (tinfo 0xac24c670)
like image 310
Klumpted Avatar asked Jan 01 '18 12:01

Klumpted


1 Answers

I went to the Settings->Advanced in the Extented Controls in the emulator and then to Advanced and changed the OpenGL ES Render to SwiftShader and the OpenGL ES API level to Compatibility (OpenGL ES 1.1/2.0) and the errors appear to have gone away and the screen is now not displaying a white screen and is instead is displaying the google map, which is what the program is supposed to do. Does this seem like a good solution? Is there more I should do to not get screwed up in the future?

like image 91
Greg Kendall Avatar answered Sep 21 '22 13:09

Greg Kendall