Skip to content
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

xcodebuild ... archive hangs without any output (missing shared scheme) #53

Closed
patrickbussmann opened this issue Oct 15, 2016 · 8 comments

Comments

@patrickbussmann
Copy link

Hey guys,

I have a problem with my Pro-Test-Account of Bitrise.io.
After I configured a complete workflow I always get a build process of 45 minutes - then the build aborts.
On my local computer it takes no minute to execute the xcodebuild command to complete.
The steps before the xCode command takes around 6 minutes.
So normally it should be possible to finish everything within 10 minutes 👍

Workflow

  1. Preparing the Build Environment
  2. Activate SSH key (RSA private key)
  3. Git Clone Repository
  4. Do anything with Script step
  5. Xcode Archive for iOS
  6. Cleaning up the Virtual Machine

The "do anything" is only for preparing the project. It's a cordova / ionic v2 project. So I must do npm install -g ionic cordova for example before ionic build ios. Then the platforms/ios folder is available with the TestApp.xcodeproj file in it.

Configuration

Version: Always latest
Should this step run even if a previous step failed?: No
Select method for export: auto-detect
Include bitcode: yes
Rebuild from bitcode: yes
The Developer Portal team to use for this export:
Working directory: $BITRISE_SOURCE_DIR/platforms/ios
Project (or Workspace) path: $BITRISE_SOURCE_DIR/platforms/ios/TestApp.xcodeproj
Scheme name: TestApp
Configuration name:
Output directory path: $BITRISE_DEPLOY_DIR
Force Developer Portal team to use during archive: AY2H9C3YC1
Force code signing with Identity:
Force code signing with Provisioning Profile Specifier:
Force code signing with Provisioning Profile: b284373b-9b5f-4e01-9af0-6442b6bb5222
Do a clean Xcode build before the archive?: no
Output tool: xcodebuild (xcpretty tested, too and not working, too!)
Additional options for xcodebuild call:
Export the generated archive?: yes
Use deprecated ipa export method?: no
Export all dsyms: no
Custom export options plist content: ad-hoc

Log

[...]

Touch build/emulator/TestApp.app
    cd /Users/vagrant/git/platforms/ios
    export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/Users/vagrant/.bitrise/tools:/usr/local/bin:/usr/local/sbin:~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/go/libexec/bin:/Users/vagrant/go/bin:/Users/vagrant/bitrise/tools/cmd-bridge/bin/osx"
    /usr/bin/touch -c /Users/vagrant/git/platforms/ios/build/emulator/TestApp.app



CodeSign build/emulator/TestApp.app
    cd /Users/vagrant/git/platforms/ios
    export CODESIGN_ALLOCATE=/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
    export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/Users/vagrant/.bitrise/tools:/usr/local/bin:/usr/local/sbin:~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/go/libexec/bin:/Users/vagrant/go/bin:/Users/vagrant/bitrise/tools/cmd-bridge/bin/osx"

Signing Identity:     "-"

    /usr/bin/codesign --force --sign - --timestamp=none /Users/vagrant/git/platforms/ios/build/emulator/TestApp.app



** BUILD SUCCEEDED **


|                                                                              |
+----+--------------------------------------------------------------+----------+
| ✅  | Do anything with Script step                                 | 286 sec  |
+----+--------------------------------------------------------------+----------+

                                          ▼

+------------------------------------------------------------------------------+
| (3) xcode-archive                                                            |
+------------------------------------------------------------------------------+
| id: xcode-archive                                                            |
| version: 1.10.1                                                              |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: bash                                                                |
| time: 2016-10-15T13:20:03-07:00                                              |
+------------------------------------------------------------------------------+
|                                                                              |
INFO[13:20:03]  * [OK] Step dependency (xcode) installed, available. 

ipa export configs:

Ignoring the following options because custom_export_options_plist_content provided:
  * export_method: auto-detect
  * upload_bitcode: yes
  * compile_bitcode: yes
  * team_id: 
----------
  * use_deprecated_export: no
  * force_team_id: AY2H9C3YC1
  * force_provisioning_profile_specifier: 
  * force_provisioning_profile: b284373b-9b5f-4e01-9af0-6442b6bb5222
  * force_code_sign_identity: 
  * custom_export_options_plist_content: 
ad-hoc

xcodebuild configs:
  * output_tool: xcpretty
  * workdir: /Users/vagrant/git/platforms/ios
  * project_path: /Users/vagrant/git/platforms/ios/TestApp.xcodeproj
  * scheme: TestApp
  * configuration: 
  * output_dir: /Users/vagrant/deploy
  * is_clean_build: no
  * xcodebuild_options: 

step output configs:
  * is_export_xcarchive_zip: yes
  * export_all_dsyms: no

step determined configs:
  * xcodebuild_version: Xcode 8.1 (Build version 8T47)
  * xcpretty_version: 0.2.4
  * CONFIG_xcode_project_action: -project

/Users/vagrant/git
  * archive_path: /var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/tmp.Zkoye11M/TestApp.xcarchive
  * ipa_path: /Users/vagrant/deploy/TestApp.ipa
  * dsym_zip_path: /Users/vagrant/deploy/TestApp.dSYM.zip

Switching to working directory: /Users/vagrant/git/platforms/ios

Create the Archive ...
  Forcing Team ID: AY2H9C3YC1
  Forcing Provisioning Profile: b284373b-9b5f-4e01-9af0-6442b6bb5222
  $ set -o pipefail && xcodebuild -project "/Users/vagrant/git/platforms/ios/TestApp.xcodeproj" -scheme "TestApp" archive -archivePath "/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/tmp.Zkoye11M/TestApp.xcarchive" DEVELOPMENT_TEAM="AY2H9C3YC1" PROVISIONING_PROFILE="b284373b-9b5f-4e01-9af0-6442b6bb5222" | tee /var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/tmp.GS4184ue/raw-xcodebuild-output.log | xcpretty
@viktorbenei
Copy link
Contributor

Most likely you did not share the scheme you try to archive - that's a known Xcode bug: https://bitrise-io.github.io/devcenter/ios/known-xcode-issues/#everyany-xcode-command-hangs

Make sure that the scheme is shared and that you don't gitignore the required Xcode files: http://devcenter.bitrise.io/v1.0/docs/scheme-cannot-be-found

@viktorbenei
Copy link
Contributor

I'll close this issue, but if Shared scheme would not fix the issue just let us know and we'll reopen it

@viktorbenei
Copy link
Contributor

viktorbenei commented Oct 16, 2016

I forgot to mention that if your tool which generates the Xcode project doesn't have an option to make the scheme as shared (it should, and if it does you should use that option!) we have a Recreate User Schemes step which can help

@viktorbenei
Copy link
Contributor

viktorbenei commented Oct 16, 2016

Another thing/note: this issue can be reproduced locally too, if you do a clean git clone (into a new directory) and try to run Xcode's command line tools without opening the project in Xcode.app. Xcode.app auto-generates missing user schemes when you open the project, but Xcode's command line tools do not.

You can also use our CLI to run/debug the build locally: https://www.bitrise.io/cli

@patrickbussmann
Copy link
Author

Thank you Viktor.
I tried it with the cool Bitrise CLI and got same problem.

Cordova said I can use CodeSign only without xcodebuild.
I try to execute codesign only without it.
Else I try your last comments idea :-)

Thanks. I'll inform you here about result.

Am 16.10.2016 um 08:18 schrieb Viktor Benei notifications@github.com:

Another thing/note: this issue can be reproduced locally too, if you do a clean git clone (into a new directory) and try to run Xcode's command line tools without opening the project in Xcode.app. Xcode.app auto-generates missing user projects when you open the project, but Xcode's command line tools do not.

You can also use our CLI to run/debug the build locally: https://www.bitrise.io/cli


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@viktorbenei
Copy link
Contributor

Thanks, keep us updated! ;)

@patrickbussmann
Copy link
Author

Ok thank you very much again, @viktorbenei.
After adding the recreate-user-schemes step I got this error messages.

=== BUILD TARGET TestApp OF PROJECT TestApp WITH CONFIGURATION Release ===

Check dependencies
TestApp has conflicting provisioning settings. TestApp is automatically signed for development, but a conflicting code signing identity iPhone Distribution has been manually specified. Set the code signing identity value to "iPhone Developer" in the build settings editor, or switch to manual signing in the project editor.
Code signing is required for product type 'Application' in SDK 'iOS 10.1'

** ARCHIVE FAILED **


The following build commands failed:
    Check dependencies
(1 failure)
|                                                                              |
+----+--------------------------------------------------------------+----------+
| 🚫  | TestApp xCode Archive for iOS (exit code: 1)                 | 12 sec   |
+----+--------------------------------------------------------------+----------+
| Issue tracker: https://github.com/bitrise-io/steps-new-xcode-archive/issues  |
| Source: https://github.com/bitrise-io/steps-new-xcode-archive                |
+----+--------------------------------------------------------------+----------+


+------------------------------------------------------------------------------+
|                               bitrise summary                                |
+----+--------------------------------------------------------------+----------+
|    | title                                                        | time (s) |
+----+--------------------------------------------------------------+----------+
| ✅  | activate-ssh-key                                             | 3.7 sec  |
+----+--------------------------------------------------------------+----------+
| ✅  | git-clone                                                    | 12 sec   |
+----+--------------------------------------------------------------+----------+
| ✅  | Do anything with Script step                                 | 344 sec  |
+----+--------------------------------------------------------------+----------+
| ✅  | recreate-user-schemes                                        | 11 sec   |
+----+--------------------------------------------------------------+----------+
| 🚫  | TestApp xCode Archive for iOS (exit code: 1)                 | 12 sec   |
+----+--------------------------------------------------------------+----------+
| Issue tracker: https://github.com/bitrise-io/steps-new-xcode-archive/issues  |
| Source: https://github.com/bitrise-io/steps-new-xcode-archive                |
+----+--------------------------------------------------------------+----------+
| Total runtime: 383 sec                                                       |
+------------------------------------------------------------------------------+

I try to solve it now. Maybe I can't select ad-hoc and must use development instead. Or something is wrong with the provisioning profiles?
I used your "doc" for this and uploaded the generated provisioning and p12 files.
Now I try using the local cli. Yesterday the xcodebuild command worked - after one xCode build 👍

@viktorbenei
Copy link
Contributor

This is an unrelated, code sign issue - you can find more info and help in this blog post: http://blog.bitrise.io/2016/09/21/xcode-8-and-automatic-code-signing.html

If that wouldn't help please create a new issue for that problem.

@viktorbenei viktorbenei changed the title xcodebuild takes more than 45 minutes!? xcodebuild ... archive hangs without any output (missing shared scheme) Oct 16, 2016
@github-actions github-actions bot locked and limited conversation to collaborators Apr 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants