首页 > 解决方案 > Flutter 构建 apk 并安装得到 flash 空白屏幕

问题描述

当我构建颤振应用程序并安装在真正的安卓手机上时,我得到了这些错误。

Launching lib/src/config/flavors/main_stage.dart on DUB AL00 in debug mode...
✓ Built build/app/outputs/apk/debug/app-debug.apk.
E/flutter (32542): [ERROR:flutter/shell/gpu/gpu_surface_gl.cc(70)] Failed to setup Skia Gr context.
Error connecting to the service protocol: HttpException: Connection closed before full header was received, uri = http://127.0.0.1:52745/fiENvL9drJE=/ws
Exited (sigterm)

我在谷歌上搜索说 add --enable-software-rendering ,这适用于调试模式,但是当我构建可安装的 APK 时如何工作?如果我以发布模式运行,则此参数不起作用。

有人可以帮忙吗?谢谢

标签: androidflutter

解决方案


flutter run --enable-software-rendering应该作为一种解决方法。CC @mit-mit, @cbracken @chinmaygarde 我以为我们已经决定让 Android Emulators 默认为软件渲染?(我似乎找不到跟踪的问题)? 资源


推荐阅读