diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_metal_impeller.mm b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_metal_impeller.mm index 7a90c0acae..3800646e7b 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_metal_impeller.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_metal_impeller.mm @@ -58,8 +58,11 @@ GPUCAMetalLayerHandle IOSSurfaceMetalImpeller::GetCAMetalLayer(const SkISize& fr // When there are platform views in the scene, the drawable needs to be presented in the same // transaction as the one created for platform views. When the drawable are being presented from - // the raster thread, participate with the implicit CA transaction. - layer.presentsWithTransaction = YES; + // the raster thread, we may not be able to use a transaction as it will dirty the UIViews being + // presented. If there is a non-Flutter UIView active, such as in add2app or a + // presentViewController page transition, then this will cause CoreAnimation assertion errors and + // exit the app. + layer.presentsWithTransaction = [[NSThread currentThread] isMainThread]; return layer; }