8000 integration_test: Can't run XCode "Product" --> "Test" · Issue #85444 · flutter/flutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

integration_test: Can't run XCode "Product" --> "Test" #85444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nilsreichardt opened this issue Jun 28, 2021 · 5 comments
Closed

integration_test: Can't run XCode "Product" --> "Test" #85444

nilsreichardt opened this issue Jun 28, 2021 · 5 comments
Labels
a: tests "flutter test", flutter_test, or one of our tests f: integration_test The flutter/packages/integration_test plugin platform-ios iOS applications specifically r: fixed Issue is closed as already fixed in a newer version

Comments

@nilsreichardt
Copy link
Contributor
nilsreichardt commented Jun 28, 2021

Description

I tried to set up XCTest with the integration_test package. What I did is:

  1. Create a new fresh flutter project with flutter create
  2. Add integration test (I copied the widget test as integration test)
  3. Run integration test with flutter drive --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart -d 63B1E047-86E5-462C-9B49-16E6FD9F131D --> everything worked ✅
  4. Now I followed the steps to set tup the XCTests: https://github.com/flutter/flutter/tree/master/packages/integration_test#ios-device-testing
  5. For this I created a new target, which I called RunnerTests
  6. Added this to my Podfile:
target 'RunnerTests' do
    inherit! :search_paths
  end
  1. Replaced RunnerTests.m with:
@import XCTest;
@import integration_test;

INTEGRATION_TEST_IOS_RUNNER(RunnerTests)
  1. And finally I tried to run the test via XCode: "Product" --> "Test" (or the shortcut: Command + U)

Problem

XCode started building, but I got this expection:

can't link with a main executable file '/Users/nils/Library/Developer/Xcode/DerivedData/Runner-agxmbwcpuxvqzdbzeonhnekntuhm/Build/Products/Debug-iphonesimulator/Runner.app/Runner' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

image

Tested device

Running build from MacBook Pro M1, macOS 11.3. Tried to build for iOS Simulator.

Code to reproduce

I published all my Code in this Repo: https://github.com/nilsreichardt/integration_test_problem

Flutter Doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.2-0.0.pre.1, on macOS 11.3 20E232 darwin-arm, locale en-DE)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.1.2)
[✓] VS Code (version 1.58.0-insider)
[✓] Connected device (4 available)
    ! Error: iPhone von Roland is not connected. Xcode will continue when iPhone von Roland is connected. (code -13)

! Doctor found issues in 1 category.
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Jun 28, 2021
@darshankawar
Copy link
Member

@nilsreichardt
Thanks for the detailed report.
Does it build for you from command line if you try: flutter build ios --config-only integration_test/foo_test.dart

And can you also please provide the entire exception log here ?

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jun 28, 2021
@nilsreichardt
Copy link
Contributor Author

Hi @darshankawar, thanks for the quick response!

flutter build ios --config-only integration_test/app_test.dart seems to work for me.

flutter build ios --config-only integration_test/app_test.dart
Running "flutter pub get" in integration_test_problem...         1,549ms
Building com.example.integrationTestProblem for device (ios-release)...
Signing iOS app for device deployment using developer identity: "3rd Party Mac Developer Application: Nils
Reichardt (AJ3PMPVZ7H)"
Running pod install...                                             969ms

I tried also to do this:

  1. Run flutter build ios --config-only integration_test/app_test.dart
  2. Run in XCode "Product" -> "Test"

This does also not work for me.

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jun 28, 2021
@jmagman
Copy link
Member
jmagman commented Jun 29, 2021

Ah, we haven't updated the integration_test docs for M1. Flutter apps don't set support the arm64 iOS simulator (soon to be fixed with #85059).
There are a few ways around this.

Option A

In your RunnerTests target, find the Excluded Architectures (EXCLUDED_ARCHS) build setting. Click the right arrow disclosure indicator icon to expand the available build configurations. Hover over Debug and click the plus icon. Change Any SDK to Any iOS Simulator SDK. Add arm64 and i386 to the build settings value. (note this screenshot shows Runner but do it for your RunnerTests test target).
Screen Shot 2021-01-12 at 6 37 29 PM

Option B

Inherit the Flutter base xcconfig in the RunnerTests target. In Runner (PROJECT, not TARGET) > Info expand Configurations. Make the RunnerTests target inherit from Debug, Release, and Release.
Screen Shot 2021-06-28 at 6 14 25 PM

I recommend trying Option A.

@jmagman jmagman added documentation f: integration_test The flutter/packages/integration_test plugin platform-ios iOS applications specifically labels Jun 29, 2021
@darshankawar darshankawar added passed first triage a: tests "flutter test", flutter_test, or one of our tests and removed in triage Presently being triaged by the triage team labels Jun 29, 2021
@jmagman
Copy link
Member
jmagman commented Aug 11, 2021

This should be fixed by #87244.

@jmagman jmagman closed this as completed Aug 11, 2021
@darshankawar darshankawar added the r: fixed Issue is closed as already fixed in a newer version label Aug 11, 2021
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: tests "flutter test", flutter_test, or one of our tests f: integration_test The flutter/packages/integration_test plugin platform-ios iOS applications specifically r: fixed Issue is closed as already fixed in a newer version
Projects
None yet
Development

No branches or pull requests

3 participants
0