我使用Android Studio 3.5.1创建了一个简单的Flutter 1.9.1 + hotfix.4应用程序。成功添加新的虚拟设备(Nexus 6)并尝试运行我的应用后,出现此错误:
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
Built build\app\outputs\apk\debug\app-debug.apk.
Syncing files to device Android SDK built for x86...
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/EGL_emulation( 5106): eglMakeCurrent: 0xec5ed840: ver 3 1 (tinfo 0xec593810)
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
D/skia ( 5106): Shader compilation error
D/skia ( 5106): ------------------------
D/skia ( 5106): Errors:
D/skia ( 5106):
应用程序正常运行,但控制台显示上述错误。
我的配置:
Android Studio 3.5.1
Build#AI-191.8026.42.35.5900203,于2019年9月25日构建
JRE:1.8.0_202-release-1483-b03 amd64
JVM:JetBrains s.r.o的OpenJDK 64位服务器VM
Windows 10 Pro 64位
错误消息来自:Add ShaderErrorHandler to GrContextOptions
在以前的Flutter版本中,永久缓存已被禁用以解决该问题,但是当前在flutter引擎中已启用它:Revert "Disable the persistent cache
解决方案:
--enable-software-rendering
中的标志flutter run
或问题: