LoginSignup
2
0

More than 5 years have passed since last update.

pod install時における「No version of Xcode found that supports Swift ...」の対処方法

Last updated at Posted at 2018-09-18

環境

  • Xcode 9.3
  • Swift 4.1.2
  • CocoaPods 1.2.1

事象

各種ライブラリをPodfileよりインストールpod install時に、以下事象によりRealm以降のライブラリが上手くインストールされない。

$ pod install
Analyzing dependencies
Downloading dependencies
Using Alamofire (4.2.0)
Using CTFeedback (1.1.1)
Using Firebase (4.13.0)
Using FirebaseAnalytics (4.2.0)
Using FirebaseCore (4.0.20)
Using FirebaseInstanceID (2.0.10)
Using FirebaseMessaging (2.2.0)
Using GoogleToolboxForMac (2.1.4)
Using HockeySDK (4.1.6)
Using NendSDK_iOS (4.0.4)
Using NoticeObserveKit (0.3.0)
Using Protobuf (3.5.0)
Using R.swift (3.3.0)
Using R.swift.Library (3.0.2)
Installing Realm (2.10.0)
[!] /bin/bash -c 
set -e
sh build.sh cocoapods-setup

./scripts/swift-version.sh: line 59: [: =: unary operator expected
No version of Xcode found that supports Swift 4.1.2


[!] Smart quotes were detected and ignored in your Podfile. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.

No version of Xcode found that supports Swift 4.1.2とあり、「Swift4.1.2をサポートするXcodeのバージョンが見つかりません」と言われている。

原因

  • Xcode側のバージョンを指定していないことによるもの。

ただ今までは、Xcode側のバージョンを毎回こちら側で指定せずとも現在のXcodeのバージョンが自動で指定されていたはずだが、今回のように何かが原因でXcode側のバージョン指定が未選択状態になっていた。

対処

現在のXcodeバージョンに切り替える。

  1. Xcode側で、Xcode > Preferences > Locationsを選択する。
  2. CommandLineToolsにて現在のバージョンを指定する。

Locations_と_AppDelegate_swift.png

参考URL

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0