为什么安卓模拟器不起作用



当我几天前更新Android Studio时,Android Emulator停止工作。我尝试打开一个空白活动,但模拟器也无法正常工作。

所有 SDK 工具均已安装并更新。下面是我运行空白活动时空白活动(Hello World!(的事件日志和 Logcat。

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:Mediaplatform-toolsadb.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:UsersAndroid Studio.androidavdNexus_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)

我转到模拟器中扩展控件中的设置>高级,然后转到高级并将 OpenGL ES 渲染更改为 SwiftShader,将 OpenGL ES API 级别更改为兼容性(OpenGL ES 1.1/2.0(,错误似乎已经消失,屏幕现在不显示白屏,而是显示谷歌地图, 这就是程序应该做的。 这似乎是一个很好的解决方案吗?我应该做的还有什么事情来避免将来搞砸吗?

最新更新