LoginSignup
3
4

More than 3 years have passed since last update.

iOS開発で、先にcocoapodsを利用しているprojectに後からXcodeGenを導入する場合のつまづきポイント

Last updated at Posted at 2019-07-15

概要

  • iOS開発にて、プロジェクトを作成後にcocoapodsを既に利用し始めた後で、XcodeGenを使いたいと思うシチュエーショがたまにあるかと思います
  • 上記シチュエーションにて、XcodeGen導入時にエラーが出て苦しんだので、自分が解決した方法を紹介します

環境

  • Xcode Version 10.2.1
  • cocoapods 1.6.0

XcodeGen導入の方法

https://qiita.com/Alex_mht_code/items/bd421275d3fa6ab160c6
こちらを参考にしました。

出ていたエラー

diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

試してだめだった解決策

うまくいった解決策

$ xcconfig-extractor {prj_dir}/{prj_name}.xcodeproj configs

にて生成したconfigファイルの

  • configs/ProjectName-Release.xcconfig
  • configs/ProjecName-Debug.xcconfig

それぞれに、下記のコードを追加します。(ProjectNameにプロジェクト名を入れてください。)

configs/ProjectName-Release.xcconfig
#include "Pods/Target Support Files/Pods-<Project名>/Pods-<Project名>.release.xcconfig"
configs/ProjectName-Debug.xcconfig
#include "Pods/Target Support Files/Pods-<Project名>/Pods-<Project名>.debug.xcconfig"

以上で、
$ xcodegen
$ pod install
を行うと無事ビルドできました。
いまいち原因はわかりませんが、誰かのお力になれたら幸いです。

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