Skip to content

Coverage crash when running tests on Android/iOS simulators from macOS build #2794

@leonardmatasel-dinova

Description

@leonardmatasel-dinova

Hi,

I'm the same guy who opened this issue: #2768. Since I couldn’t reopen it, I decided to create a new one because the problem seems to be different this time

Steps to reproduce

patrol test --coverage -t "integration_test/login_1_google_test.dart" --verbose

Actual results

Currently, when trying to run Patrol with --coverage, we encounter a runtime error, preventing us from collecting coverage data.

After this error:

Unhandled exception:
Bad state: No element

roughly 10 seconds, the app begins executing tests on the emulator (same behavior on iOS and Android), but the process then stops. The emulator only completes the initial setup, the terminal execution stop, and the coverage data is never generated.

Image

Logs

BUILD SUCCESSFUL in 3s
        : 1133 actionable tasks: 12 executed, 1121 up-to-date
✓ Completed building apk with entrypoint test_bundle.dart (34.9s)
Will uninstall apps before running tests
Uninstalling it.injenia.tools.interacta.mobile from sdk gphone64 arm64
Uninstalling it.injenia.tools.interacta.mobile.test from sdk gphone64 arm64
$ fvm flutter logs -d emulator-5554
• Executing tests of apk with entrypoint test_bundle.dart on emulator-5554...
$ ./gradlew :app:connectedFlavor_dev_envDebugAndroidTest -Ptarget=/Users/codebusters/products-interacta-frontend-mobile-native/interacta_app/integration_test/test_bundle.dart -Pdart-defines=UEFUUk9MX0FQUF9QQUNLQUdFX05BTUU9aXQuaW5qZW5pYS50b29scy5pbnRlcmFjdGEubW9iaWxl,UEFUUk9MX0FQUF9CVU5ETEVfSUQ9aXQuaW5qZW5pYS50b29scy5pbnRlcmFjdGEubW9iaWxl,UEFUUk9MX0FORFJPSURfQVBQX05BTUU9SW50ZXJhY3Rh,UEFUUk9MX0lPU19BUFBfTkFNRT1JbnRlcmFjdGE=,SU5URUdSQVRJT05fVEVTVF9TSE9VTERfUkVQT1JUX1JFU1VMVFNfVE9fTkFUSVZFPWZhbHNl,UEFUUk9MX1RFU1RfTEFCRUxfRU5BQkxFRD10cnVl,UEFUUk9MX1RFU1RfU0VSVkVSX1BPUlQ9ODA4MQ==,UEFUUk9MX0FQUF9TRVJWRVJfUE9SVD04MDgy,Q09WRVJBR0VfRU5BQkxFRD10cnVl -Papp-server-port=8082 -Ptest-server-port=8081
Unhandled exception:
Bad state: No element

Patrol version

patrol: ^3.20.0

Patrol Doctor output

Patrol doctor:
Patrol CLI version: 3.11.0
Flutter command: fvm flutter
Flutter 3.35.7 • channel stable
Android:
• Program adb found in /Users/codebusters/Library/Android/sdk/platform-tools/adb
• Env var $ANDROID_HOME set to /Users/codebusters/Library/Android/sdk
iOS / macOS:
• Program xcodebuild found in /usr/bin/xcodebuild
• Program ideviceinstaller found in /opt/homebrew/bin/ideviceinstaller

Flutter Doctor output

fvm flutter doctor --verbose
[✓] Flutter (Channel stable, 3.35.7, on macOS 15.6.1 24G90 darwin-arm64, locale it-IT) [383ms]
• Flutter version 3.35.7 on channel stable at /Users/codebusters/fvm/versions/3.35.7
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision adc9010625 (4 weeks ago), 2025-10-21 14:16:03 -0400
• Engine revision 035316565a
• Dart version 3.9.2
• DevTools version 2.48.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-lldb-debugging

[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [2,6s]
• Android SDK at /Users/codebusters/Library/Android/sdk
• Emulator version 34.2.16.0 (build_id 12038310) (CL:N/A)
• Platform android-36, build-tools 35.0.0
• ANDROID_HOME = /Users/codebusters/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: flutter config --jdk-dir="path/to/jdk".
• Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[✓] Xcode - develop for iOS and macOS (Xcode 26.1) [1.423ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 17B55
• CocoaPods version 1.16.2

[✓] Chrome - develop for the web [8ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.1) [7ms]
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)

[✓] VS Code (version 1.104.1) [6ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available) [6,1s]
• iPhone 17 Pro (mobile) • 074C2745-DF5F-4E74-AA34-D85D3745C785 • ios • com.apple.CoreSimulator.SimRuntime.iOS-26-1 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 15.6.1 24G90 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 142.0.7444.162

[✓] Network resources [1.585ms]
• All expected network resources are available.

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions