Flutter App Crashing on iOS with Appium Due to Deallocation Error

Question:

I am using Appium for automation testing of our Flutter app. The tests are running fine on Android, but when running the same scripts on iOS, the application crashes, and we receive the following error: -[FlutterPlatformViewSemanticsContainer retain]: message sent to deallocated instance

Description:

We are currently facing a significant issue while running our Appium automation tests on an iOS device for our Flutter application. The problem arises specifically with the FlutterPlatformViewSemanticsContainer, which appears to be deallocated and then accessed, leading to a crash. This issue does not occur during manual testing or when running the same automation scripts on Android.

Here are the details of our environment:

  1. Flutter Version: 3.22.1
  2. Appium Version: v2.1.0
  3. iOS Version: 15.0
  4. Device: Simulator iPhone
  5. Automation Framework: Appium with Java
  6. Driver: [email protected] (automationName ‘XCUITest’)

Observations:

  1. The error is specific to iOS; the same scripts work perfectly fine on Android.
  2. The crash happens due to a message being sent to a deallocated instance of FlutterPlatformViewSemanticsContainer.

I am looking for assistance in resolving this deallocation issue. Here are my questions:

  1. What might be causing this deallocation error in the Flutter app when running automation tests on iOS?
  2. Are there any specific configurations or capabilities needed in Appium for iOS that could help prevent this issue?
  3. Is there a known issue with FlutterPlatformViewSemanticsContainer that I should be aware of, and if so, what are the possible workarounds?

Any guidance or suggestions on how to resolve this issue would be greatly appreciated.Thank you!

  • Zeel Chaudhari