Flutter App Crashing with Impeller Rendering Backend Error on iOS Simulator
Asked Answered
T

4

12

I'm encountering a consistent crash in my Flutter application when running it on the iOS Simulator. The issue seems to be related to the Impeller rendering backend, as indicated by an error message I received. I'm seeking guidance on how to resolve this.

Error Message:

[ERROR:flutter/shell/platform/darwin/graphics/FlutterDarwinContextMetalImpeller.mm(42)] Using the Impeller rendering backend.

Environment:

  • Flutter Version: 3.16.0 (Channel Stable)
  • Dart Version: 3.2.0
  • Xcode Version: 15.0.1
  • macOS Version: 14.1.1
  • iOS Simulator: iPhone 15 Pro Max (iOS 17.0)
  • Dependencies Used:
    • cupertino_icons: ^1.0.2
    • google_mobile_ads: ^3.1.0
    • flutter_launcher_icons: ^0.13.1

Issue Description: The app crashes shortly after launch without a clear indication of the root cause. The crash report generated by the iOS Simulator does not contain specific error messages or stack traces that point directly to the issue.

Steps Taken:

Created project from scratch same error was appearing the startup page and when i included the real project it crashed

The project is running perfect on Window with Android Emulator but on the Mac showing this error

My Questions: Impeller Rendering Backend Crash: What could be causing the Flutter app to crash related to the Impeller rendering backend? Are there specific settings or configurations in the Flutter environment that might lead to this issue?

Version Compatibility: Are there any known compatibility issues with Flutter version 3.16.0 or the dependencies I am using (e.g., google_mobile_ads: ^3.1.0, flutter_launcher_icons: ^0.13.1) that could be contributing to this crash?

Diagnosing the Crash: How can I further diagnose the root cause of this crash? Are there specific logs or debugging steps that would provide more insights into the issue?

If any more information is required please let me know to help fix this issue. Any help or insights into this problem would be greatly appreciated.

Thank you!

Tuft answered 22/11, 2023 at 12:33 Comment(5)
hello please open your ios project in xcode then run project. And tell me your error logs. This is the most effective way for debuggingSilvanus
This issue seems to be with google_mobile_ads. There's an issue on GitHub about this: github.com/googleads/googleads-mobile-flutter/issues/363Citrus
@AizanSagheer could you provide more details for the google ad mob issueTuft
The above github issue is from 2021, not sure how relevant it is. I am running into the same issue as above, and none of the solutions below helped.Siret
My app was crashing in the simulator. When I debugged on my phone using Xcode, it crashed again in the same scenario, and the error was related to Impeller. @Andreas Hadjimamas's answer fixed the issue.Gules
F
11

Flutter enables Impeller by default on iOS.

To disable Impeller on iOS when debugging, pass --no-enable-impeller to the flutter run command.

flutter run --no-enable-impeller

To disable Impeller on iOS when deploying your app, add the following tags under the top-level tag in your app’s Info.plist file.

<key>FLTEnableImpeller</key>
<false />

Found similar question Similar question link

Foreman answered 29/11, 2023 at 11:21 Comment(0)
B
6

The "Impeller Rendering Backend Error" is a common issue in Flutter, especially when working with the iOS simulator.

  1. Clean and Rebuild:
    flutter clean
    
    flutter pub get
    
    flutter run
  1. Update Flutter and Dart:
    flutter upgrade

    flutter pub upgrade
  1. Update Xcode: Ensure that Xcode is up to date. Flutter relies on Xcode for building and running iOS apps. Open the App Store on your Mac, go to the "Updates" tab, and check for Xcode updates.

  2. Update CocoaPods:

    sudo gem install cocoapods

    pod repo update
  1. iOS Simulator Issues: Try running your app on a different iOS simulator device. Sometimes, specific simulator configurations can cause issues.

That's all I can suggest, Hope this resolves your error

Birdlime answered 25/11, 2023 at 5:22 Comment(0)
A
0

I got the same issue with my 3.19.5 Flutter. In my case the reason was recently installed "open-filex" plug-in. As indicates in description

A plug-in that can call native APP to open files with string result in flutter

I found from many other same issue topics in web that interaction with native elements could be a reason of Impeller error. So I removed this plug-in, re-launched app and voila, it became alive again.

My advice - try to remember when this error appeared. Then check if you installed before any plug-in or library what works with native elements. Try to remove any suspicious dependency and check if it hepls.

Good luck!

Absorber answered 27/5 at 19:22 Comment(2)
Oh, I have same problem and recently installed open_filex plugin and I wonder how to deal with it as I need open_filex and I need iOS app to run There are other similar packages that will work?Orpha
Unfortunately I didn't found and similar package. I had to change the way to get necessary resultAbsorber
P
0

I encountered the same issue when rendering a Lottie Memory File, so I added renderCache: RenderCache.drawingCommands to resolve it.

Before

LottieBuilder.memory(
      image,
      width: width,
      height: height,
      fit: fit,
      repeat: repeat,
      errorBuilder: (context, error, stackTrace) => const 
 Icon(Icons.error),
    )

After

LottieBuilder.memory(
      image,
      width: width,
      height: height,
      renderCache: RenderCache.drawingCommands,
      fit: fit,
      repeat: repeat,
      errorBuilder: (context, error, stackTrace) => const Icon(Icons.error),
    )
Paiz answered 23/6 at 5:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.