Install Realm via cocoapods
Realm to be installed and integrated into my project.
Cocoapods fails to install Realm.
$ pod install --verbose
...<installing a bunch of other pods>...
[Step 1/1] -> Installing Realm (1.1.0)
[22:31:45][Step 1/1] > Git download
[22:31:45][Step 1/1] > Git download
[22:31:45][Step 1/1] $ /usr/local/bin/git clone https://github.com/realm/realm-cocoa.git /Users/teamcity/buildAgent/temp/buildTmp/d20160918-30805-8iqw7m --template= --single-branch --depth 1 --branch v1.1.0
[22:31:45][Step 1/1] Cloning into '/Users/teamcity/buildAgent/temp/buildTmp/d20160918-30805-8iqw7m'...
[22:31:46][Step 1/1] Note: checking out '5fbb4ce86b0679c2ced0babd2f1cfaf33f5dd68f'.
[22:31:46][Step 1/1]
[22:31:46][Step 1/1] You are in 'detached HEAD' state. You can look around, make experimental
[22:31:46][Step 1/1] changes and commit them, and you can discard any commits you make in this
[22:31:46][Step 1/1] state without impacting any branches by performing another checkout.
[22:31:46][Step 1/1]
[22:31:46][Step 1/1] If you want to create a new branch to retain commits you create, you may
[22:31:46][Step 1/1] do so (now or later) by using -b with the checkout command again. Example:
[22:31:46][Step 1/1]
[22:31:46][Step 1/1] git checkout -b <new-branch-name>
[22:31:46][Step 1/1]
[22:31:46][Step 1/1] $ /usr/local/bin/git submodule update --init --recursive
[22:31:46][Step 1/1] Cloning into 'Realm/ObjectStore'...
[22:31:48][Step 1/1] Cloning into 'external/catch'...
[22:31:49][Step 1/1] Cloning into 'external/pegtl'...
[22:31:50][Step 1/1] Submodule 'Realm/ObjectStore' (https://github.com/realm/realm-object-store.git) registered for path 'Realm/ObjectStore'
[22:31:50][Step 1/1] Submodule path 'Realm/ObjectStore': checked out '7922710805950c353f00c4ba5146e2ff98aa8aa9'
[22:31:50][Step 1/1] Submodule 'external/catch' (https://github.com/philsquared/Catch) registered for path 'external/catch'
[22:31:50][Step 1/1] Submodule 'external/pegtl' (https://github.com/ColinH/PEGTL) registered for path 'external/pegtl'
[22:31:50][Step 1/1] Submodule path 'Realm/ObjectStore/external/catch': checked out 'f294c9847272b1b92c5119a6f711e57113b5f231'
[22:31:50][Step 1/1] Submodule path 'Realm/ObjectStore/external/pegtl': checked out '3c4128a7e7e1288eb746418ea60c41477358f26a'
[22:31:50][Step 1/1] > Running prepare command
[22:31:50][Step 1/1] $ /usr/local/bin/bash -c set -e sh build.sh cocoapods-setup
[22:31:51][Step 1/1] [!] /usr/local/bin/bash -c
[22:31:51][Step 1/1] set -e
[22:31:51][Step 1/1] sh build.sh cocoapods-setup
[22:31:51][Step 1/1]
[22:31:51][Step 1/1]
[22:31:51][Step 1/1] /Users/teamcity/buildAgent/work/f2f57e36510e3c2e/.gem/ruby/2.2.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/executable.rb:69:in `execute_command'
...<rest of stack>...
Not sure. I can't reproduce on my own MacBook. This is only happening on the build machine.
Realm version: 1.0.1, 1.1.0
Xcode version: Xcode 8
Dependency manager + version: cocoapods 1.0.1 and 1.1.0.rc.2
I've tried wiping out the cache and pods directory and it hasn't worked. I'm running short on ideas here.
I'm in the same trouble with this!!
Frankly, I choose the 1.0.2 version instead of 1.1.0
But I want to use the newest version of Realm in my project
plz, let me know how to solve or to avoid this situation
@SandyChapman @jegumhon You need update your Pod to version 1.1.0.rc.2
I just test and it work
Link relate: https://github.com/realm/realm-cocoa/issues/4107
Having the same issue with pod spec lint, using 1.1.0.rc.2 and realm 1.1.0 doesn't seem to fix the issue.
Also seeing it happen with cocoapods 1.1.0.rc.2 and Realm 1.1.0 (as stated in the first post).
This appears to be an issue with using Xcode 8 and performing the initial install of Realm. My guess is some incompatibility between the build.sh script and an updated build tool has happened. Current workaround is to build using Xcode 7.3.1.
Steps to reproduce:
#sudo xcode-select -s /Applications/Xcode-7.3.1.app/Contents/Developer
sudo xcode-select -s /Applications/Xcode-8.0.app/Contents/Developer # or wherever your Xcode 8 is installed
bundle install
bundle exec pod repo update
rm -rf ~/Library/Caches/CocoaPods/Pods/**/Realm*
rm -rf ./Pods
bundle exec pod install --verbose
Workaround is to ensure you have Xcode 7.3.1 installed and run the following before installing your pods.
sudo xcode-select -s /Applications/Xcode-7.3.1.app/Contents/Developer
After installing your pods, you can revert back to using Xcode 8 and continue on with writing amazing code:
sudo xcode-select -s /Applications/Xcode-8.0.app/Contents/Developer
@DavidCMurphy @jegumhon : Can you guys try the workaround suggested and post if it worked for you?
@SandyChapman I appreciate you trying to share steps to reproduce, but they're incomplete.
#sudo xcode-select -s /Applications/Xcode-7.3.1.app/Contents/Developer
sudo xcode-select -s /Applications/Xcode-8.0.app/Contents/Developer # or wherever your Xcode 8 is installed
bundle install
bundle exec pod repo update
rm -rf ~/Library/Caches/CocoaPods/Pods/**/Realm*
rm -rf ./Pods
bundle exec pod install --verbose
I assume you'd need to run this in a directory with a Gemfile or Gemfile.lock installed based on the presence of bundle exec commands. What are the contents of this file? What else is necessary for someone to reproduce this error? And have you ruled out the possibility of this being a bug in CocoaPods?
@jpsim, will follow up in a couple hours with details.
@jpsim : so I'm not able to reproduce on my macbook. This is only happening on my build machine running in TeamCity. I'm going to continue investigating to see if I can figure out how to reproduce on my macbook.
@HaLamUs Thank u!! I tried to do following your suggestion. It works!!
@SandyChapman Did you check the pod version? I was confused to check the pod version.
Because there were two pod versions after installing pod 1.1.0.rc2.
So I removed the old pod version 1.0.1, then finally I got the Realm 1.1.0 with pod.
If you already did to check this out, probably your case may be different from mine.
I hope you solve your trouble as soon as possible.
This has always been failing with the latest prerelease version of cocoa pods. Though it appears entirely a fault of cocoapods itself and this solution worked for me.
@jpsim : looks like it's a cocoapods issue. I'm closing this. @DavidCMurphy , thanks for following up!