简体   繁体   中英

CocoaPods install hangs

I'm having issues with cocoapods, where pod install always hangs at Analyzing dependencies phase. Running with --verbose flag shows that the hangup is always right after the Inspecting targets to integrate output. I've tried playing with new projects as well as in my existing workspace created by liftoff. I also wanted to mention that I have not used CocoaPods in the past, so it's quite possible I'm doing something wrong.

This doesn't seem to be the same hangup error mentioned in a few other cocoapods threads here. None of the solutions mentioned in Cocoapods staying on "analyzing dependencies" work. I'm using CocoaPods version 0.37.2.

Here is what I'm doing:

I used liftoff to create my workspace using swift template ( https://github.com/thoughtbot/liftoff ), it auto-generated a Podfile in global space, putting its own boilerplate in there. I've modified it to add pod 'CocoaLumberjack' under the line that says 'Add application pods here', single workspace entry and xcodeproj entries for each of my projects similar to this podfile: https://github.com/dblock/ARASCIISwizzle/blob/master/Podfile (except that I did not yet add my own targets). I also created a couple of my own projects from within XCode under the same workspace. Projects compile and run fine as of now, no podfiles have been used by them yet.

I followed up by running pod setup , which completed successfully. Afterwards, pod install always hangs, I checked activity monitor as well, to make sure it's not running git-remote-http on the background. I reran it with verbose, but it still hangs, here is what I'm seeing:

▶ pod install --verbose
  Preparing

Analyzing dependencies

Updating spec repositories
Updating spec repo `master`
  $ /usr/bin/git pull --ff-only
  From https://github.com/CocoaPods/Specs
     03edf73..14f2ac3  master     -> origin/master
  Updating 03edf73..14f2ac3
  Fast-forward
   .../0.2.1/CNPPopupController.podspec.json          |  26 +++++
   Specs/CommonUtils/1.5.8/CommonUtils.podspec.json   |  67 ++++++++++++
   .../0.1.1/GBSimpleWebViewController.podspec.json   |  20 ++++
   Specs/Intercom/2.3.0/Intercom.podspec.json         |  40 +++++++
   .../3.0.4/Kite-Print-SDK.podspec.json              | 121 +++++++++++++++++++++
   .../MUKDataSource/2.0.3/MUKDataSource.podspec.json |  29 +++++
   .../MUKDataSource/2.0.4/MUKDataSource.podspec.json |  29 +++++
   Specs/PNChart/0.8.5/PNChart.podspec.json           |  39 +++++++
   .../StoryboardKit/0.1.0/StoryboardKit.podspec.json |  27 +++++
   9 files changed, 398 insertions(+)
   create mode 100644 Specs/CNPPopupController/0.2.1/CNPPopupController.podspec.json
   create mode 100644 Specs/CommonUtils/1.5.8/CommonUtils.podspec.json
   create mode 100644 Specs/GBSimpleWebViewController/0.1.1/GBSimpleWebViewController.podspec.json
   create mode 100644 Specs/Intercom/2.3.0/Intercom.podspec.json
   create mode 100644 Specs/Kite-Print-SDK/3.0.4/Kite-Print-SDK.podspec.json
   create mode 100644 Specs/MUKDataSource/2.0.3/MUKDataSource.podspec.json
   create mode 100644 Specs/MUKDataSource/2.0.4/MUKDataSource.podspec.json
   create mode 100644 Specs/PNChart/0.8.5/PNChart.podspec.json
   create mode 100644 Specs/StoryboardKit/0.1.0/StoryboardKit.podspec.json

Inspecting targets to integrate

At that point, CocoaPods stays on that last line indefinitely. I've let it sit there overnight with no progress. I've tried repeating this in another test project, created manually via XCode with me running pod setup and creating a Podfile myself with the following content:

platform :ios, "6.0"
pod "CocoaLumberjack"

Once again, cocoapods hangs on the same step when I run pod install --verbose .

UPDATE: After banging my head against the wall for another day with this, I asked a friend with a Mac to try these instructions, which worked without problems on his laptop. I tried looking at my other apps and shell config to see if anything could be having unfavorable interaction with cocoapods, with no luck. I then created another user account, chown ed the project directory to new user, su ed to this user and repeated pod init and pod install from new user, both worked like a charm. I now suspect this is something in my .bashrc or profile, but have yet to figure out what.

You need to connect to the pod again by removing old setups.

  $ pod repo remove master
  $ pod setup
  $ pod install

Try this it will solve your issue.

Fixed this issue a while ago, but forgot to come back and post an update here.

The problem ended up to be quite eccentric and perhaps unique to me (or those who do a lot of tinkering with their terminal shell). I had a function named _ (underscore) in my .bashrc , which bash itself had no problem with (or at least it seemed like that until pod), zsh (the shell I use) did have a problem with it, breaking sudo command, but everything else seemed to work fine. pod was apparently affected by this as well.

So for those also experiencing this issue (and who have tinkered with their .profile, .bashrc, .zshrc), I would suggest checking for odd function names in your .bashrc or commenting out portions of it to see where the problem is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM