Skip to content
This repository has been archived by the owner on Jun 20, 2021. It is now read-only.

Build hangs, with no messages. #217

Closed
Swoogan opened this issue Feb 27, 2015 · 8 comments
Closed

Build hangs, with no messages. #217

Swoogan opened this issue Feb 27, 2015 · 8 comments

Comments

@Swoogan
Copy link

Swoogan commented Feb 27, 2015

When I run ipa build nothing happens. There is no output and the software never exits. When I Ctrl+C, I get the following:

/Library/Ruby/Gems/2.0.0/gems/shenzhen-0.11.2/lib/shenzhen/xcodebuild.rb:32:in ``': Interrupt
    from /Library/Ruby/Gems/2.0.0/gems/shenzhen-0.11.2/lib/shenzhen/xcodebuild.rb:32:in `info'
    from /Library/Ruby/Gems/2.0.0/gems/shenzhen-0.11.2/lib/shenzhen/commands/build.rb:28:in `block (2 levels) in <top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.0/lib/commander/command.rb:179:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.0/lib/commander/command.rb:179:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.0/lib/commander/command.rb:154:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.0/lib/commander/runner.rb:421:in `run_active_command'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.0/lib/commander/runner.rb:65:in `run!'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.0/lib/commander/delegates.rb:15:in `run!'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.0/lib/commander/import.rb:10:in `block in <top (required)>'

(Note, I don't know anything about this software, I'm just following documentation given to me by others). I looked through the source code and found that shenzhen ultimately calls xcodebuild. So I ran that command and I get:

Code Sign error: No codesigning identities found: No codesigning identities (i.e. certificate and private key pairs) that match the provisioning profile specified in your build settings (“[redacted]”) were found.
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 8.1'

That might be the underlying issue, but why then does shenzhen not output anything or exit?

@Swoogan
Copy link
Author

Swoogan commented Feb 27, 2015

I installed the certificates and now I get:

ipa build
Configuration was not passed, defaulting to Debug
Select a scheme:
1. Config1
2. Config2
? 

From reading the code, I don't really understand why.

@Swoogan
Copy link
Author

Swoogan commented Feb 27, 2015

Cleaned out my build and started from scratch and now the issue is back. ipa --verbose build -s xyz -c Release always just sits there forever not doing anything. Do any of the commands need access to the internet? I can't think of what else would have made this work the one time.

@Swoogan
Copy link
Author

Swoogan commented Feb 27, 2015

Ok, so I found the source of the issue. I put statements in shenzhen to see where the error was occurring. It is hanging at lib/shenzhen/xcodebuild.rb:32. It seems the command xcodebuild -list hangs on my machine. Can I suggest that with the --verbose flag shenzhen outputs that it is calling the above command?

I inadvertently made it work, after installing the certificates, by opening the project in Xcode. Before opening in Xcode, I got the following:

macbuild:ios itdev$ xcodebuild -list
Information about project "Project":
    Targets:
        Project

    Build Configurations:
        Debug
        Release

    If no build configuration is specified and -scheme is not passed then "Release" is used.
^C

Afterword, I got the following:

macbuild:ios itdev$ xcodebuild -list
Information about project "Project":
    Targets:
        Project

    Build Configurations:
        Debug
        Release

    If no build configuration is specified and -scheme is not passed then "Release" is used.

    Schemes:
        Project

I noticed a few new files and folders. I think the important one is:

Project.xcodeproj/xcuserdata/itdev.xcuserdatad/xcschemes/Project.xcscheme

So, I am thinking that maybe this is a bug in xcodebuild? It's sort of an annoyance that these user-specific files have be in source control, but I digress. I think xcodebuild should return an error rather than just hanging. I'm not sure if you should handle this weird situation in your application, or not.

@tabrindle
Copy link

Had exactly the same issue on my new CI server- turns out I had never opened Xcode and need to enable "Developer mode" on this mac. Whatever that means.

@aramkarapetian
Copy link

We have had similar problem and solution was to open/wait/close xcode and then build.

@pencilcheck
Copy link

I forgot how to generate the xcscheme file, but that file is really needed for xcodebuild to not hang, pretty frustrating

@cburyta
Copy link

cburyta commented Jun 4, 2015

Running this ruby to open / save from the CLI seems to help with the hang, I needed to do this also when using Jenkins using the Xcode plugin, so I think it's more an issue with Xcode projects. (My xcode project is created from Cordova each build so I never actually open the Xcode app.)

https://gist.github.com/shanesmith/8b88720c19b910cc9900

@ptlis
Copy link

ptlis commented Mar 14, 2016

👍 to the solution provided by @cburyta

It would be nice to have this handled automagically by shenzhen

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

7 participants