Flutter项目在iOS模拟器上调试时,遇到这个错误:
[FATAL:flutter/shell/platform/darwin/ios/ios_context.mm(29)] Check failed: backend != IOSRenderingBackend::kImpeller. Software rendering is incompatible with Impeller.
Software rendering may have been automatically selected when running on a simulator in an environment that does not support Metal. Enabling GPU pass through in your environment may fix this. If that is not possible, then disable Impeller.
Flutter在iOS平台默认使用Impeller渲染引擎,在模拟器上容易出错。解决方案:
flutter run --no-enable-impeller
如果在部署时也禁用Impeller,就修改项目的Info.plist文件:
<key>FLTEnableImpeller</key>
<false/>