LoginSignup
3
3

More than 5 years have passed since last update.

[Xcode8]CocoaPodsで外部ライブラリを追加したのにビルドできない

Posted at
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be 
configured correctly for targets which use Swift. Use the [Edit > Convert > 
To Current Swift Syntax…] menu to choose a Swift version or use the Build 
Settings editor to configure the build setting directly.

が出て、ビルドできない時の解決策

           ⬇︎

⒈ プロジェクトのSwiftのバージョンを2.3にする。

⒉ Targets -> (プロジェクト名) -> Use Legacy Swift Launguage Version を Yesにする。

⒊ latestバージョンがSwift 3で書かれているとわかるライブラリはSwift2.3で書かれたバージョンを指定する。

⒋ Podfileの最後に以下の記述をして、自動的に各ライブラリがSwift 2.3でビルドされるようにする。



post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '2.3'
    end
  end
end

pod installする。

⒍ ビルドする。

⒎ iOS10 SDKに対応するため、ライブラリのコードを修正する。

3
3
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
3
3