为什么安卓模拟器不工作

Klu*_*ted 5 android updates android-emulator

当我几天前更新 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:\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)
Run Code Online (Sandbox Code Playgroud)

小智 4

我进入模拟器扩展控制中的“设置”->“高级”,然后进入“高级”,将 OpenGL ES 渲染更改为 SwiftShader,将 OpenGL ES API 级别更改为兼容性(OpenGL ES 1.1/2.0),并且错误似乎已经消失现在屏幕不再显示白屏,而是显示谷歌地图,这就是程序应该做的事情。这看起来是一个很好的解决方案吗?我还应该做更多事情以免将来陷入困境吗?