leancodepl / patrol

Flutter-first UI testing framework. Ready for action!
https://patrol.leancode.co
Apache License 2.0
856 stars 126 forks source link

[IOS] Test Crash when add package mobile_scanner in pubspec.yaml #2274

Closed mrrhak closed 1 month ago

mrrhak commented 1 month ago

Steps to reproduce

  1. App test with patrol work normally
  2. just add new dependency call mobile_scanner: ^5.1.1 into pubspec.yaml
  3. Start app is working normally
  4. Start execute test with patrol got crashed.

Actual results

Sorry, I don't know this problem come from package mobile_scanner or from patrol but app is run normally with mobile_scanner. It's only crash on test.

Logs

Logs ``` • Building app with entrypoint test_bundle.dart for iOS simulator (debug)... ✓ Completed building app with entrypoint test_bundle.dart for iOS simulator (27.0s) • Running app with entrypoint test_bundle.dart for iOS simulator on simulator iPhone 15 Pro... --- xcodebuild: WARNING: Using the first of multiple matching destinations: { platform:iOS Simulator, id:F4165E75-5981-42F6-9DD2-2DBC29E920DE, OS:17.5, name:iPhone 15 Pro } { platform:iOS Simulator, id:F4165E75-5981-42F6-9DD2-2DBC29E920DE, OS:17.5, name:iPhone 15 Pro } 2024-07-22 16:05:09.060 xcodebuild[33294:2051983] [MT] IDETestOperationsObserverDebug: 39.028 elapsed -- Testing started completed. 2024-07-22 16:05:09.060 xcodebuild[33294:2051983] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start 2024-07-22 16:05:09.060 xcodebuild[33294:2051983] [MT] IDETestOperationsObserverDebug: 39.028 sec, +39.028 sec -- end Testing failed: RunnerUITests-Runner (33302) encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. (Underlying Error: Test crashed with signal abrt before starting test execution.)) ** TEST EXECUTE FAILED ** ✗ Failed to execute tests of app with entrypoint test_bundle.dart for iOS simulator on simulator iPhone 15 Pro (xcodebuild exited with code 65) (42.3s) Error: xcodebuild exited with code 65 See the logs above to learn what happened. Also consider running with --verbose. If the logs still aren't useful, then it's a bug - please report it. ```

Patrol version

patrol: ^3.9.0

Patrol Doctor output

Patrol Doctor output ``` Patrol doctor: Patrol CLI version: 3.0.1 Flutter command: flutter Flutter 3.22.3 • channel stable Android: • Program adb found in /Users/mrrhak/Library/Android/sdk/platform-tools/adb • Env var $ANDROID_HOME set to /Users/mrrhak/Library/Android/sdk iOS / macOS: • Program xcodebuild found in /usr/bin/xcodebuild • Program ideviceinstaller found in /opt/homebrew/bin/ideviceinstaller ```

Flutter Doctor output

Flutter Doctor output ``` [✓] Flutter (Channel stable, 3.22.3, on macOS 14.5 23F79 darwin-arm64, locale en-US) • Flutter version 3.22.3 on channel stable at /Users/mrrhak/Documents/Developments/SDK/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision b0850beeb2 (5 days ago), 2024-07-16 21:43:41 -0700 • Engine revision 235db911ba • Dart version 3.4.4 • DevTools version 2.34.3 [✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) • Android SDK at /Users/mrrhak/Library/Android/sdk • Platform android-35, build-tools 35.0.0 • ANDROID_HOME = /Users/mrrhak/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.4) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15F31d • CocoaPods version 1.14.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2024.1) • 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.91.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.92.0 [✓] Connected device (4 available) • iPhone 15 Pro (mobile) • F4165E75-5981-42F6-9DD2-2DBC29E920DE • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-5 (simulator) • macOS (desktop) • macos • darwin-arm64 • macOS 14.5 23F79 darwin-arm64 • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.5 23F79 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 126.0.6478.183 [✓] Network resources • All expected network resources are available. • No issues found! ```
fylyppo commented 1 month ago

Hi, I am not able to reproduce that behavior, could you set up some example repo so I can investigate it deeper?

mrrhak commented 1 month ago

Thank @fylyppo, Here is an example repo: https://github.com/mrrhak/myapp

piotruela commented 1 month ago

Hi @mrrhak. Thanks for the reproducible sample. I checked the issue and in the logs it says that:

This copy of libswiftCore.dylib requires an OS version prior to 12.2.0. 2024-07-25 19:32:38.803238+0200 RunnerUITests-Runner[30802:12703449] This copy of libswiftCore.dylib requires an OS version prior to 12.2.0

After changing deployment target to 12.2 for RunnerUITests the test was executed successfully.

image

Closing this issue. If the same solution won't work for you, feel free to reopen it and provide more info.

mrrhak commented 1 month ago

Yes, after change to 12.2 it's working. Thanks for your support.

github-actions[bot] commented 1 month ago

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.