# 【Xcode】Manifest.lock: No such file or directoryエラーの対処方法

> Xcodeでdiff: /ios/Pods/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.のエラーの対処方法を解説します。

- 公開日: 2024-11-14
- 著者: Matsu
- タグ: Flutter
- URL: https://tech.anycloud.co.jp/articles/xcode-manifest-lock-no-such

---

XcodeでiOSのビルド時のエラーについて解決方法を紹介します。

## **Manifest.lock: No such file or directoryエラー**

Xcodeでのビルド時に以下のエラーに遭遇しました。

1回目のビルドは成功しているのですが、コードの修正をかけた2回目以降は以下のエラーでビルドできませんでした。

CocoaPodsの`Podfile.lock`と`Pods`フォルダが同期していないために発生しているようです。

```shell
cizvmzhwiidatdcgnwerwaqiqaba/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Script-D3750CAE04A01601A0A79291.sh (in target 'Runner' from project 'Runner')
    cd /Users/path/ios
    /bin/sh -c /Users/Library/Developer/Xcode/DerivedData/Runner-cizvmzhwiidatdcgnwerwaqiqaba/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Script-D3750CAE04A01601A0A79291.sh

diff: /Users/path/ios/Pods/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.
```

## pod installするも解決せず…

以下、iOSまわりのリフレッシュするもビルドして同じエラーで解決せずでした。

```shell
% sudo gem install cocoapods
% rm Podfile.lock
% pod install --repo-update
% fvm flutter clean && fvm flutter pub get
```

### User-Definedも対応済み

この辺りのエラーを調べていると、`User-Defined`を追加することで解決されるとありました。

<div class="link-card-wrap"><a class="link-card" href="https://ateliee.com/archives/2364" target="_blank" rel="noopener noreferrer"><span class="link-card-body"><span class="link-card-title">Podインストールしたのに「diff: /../Podfile.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.」のエラーが出現した際の対処法 | @技術屋のメモ | WEB/アプリ開発技術メモ</span><span class="link-card-meta"><span class="link-card-domain">ateliee.com</span></span></span><img class="link-card-image" src="./linkcard-01-image.webp" alt=""></a></div>

1.  プロジェクトのBuild-SettingsにUser-Definedがなければ、追加
2.  名前をPODS\_ROOT、値を${SRCROOT}/Podsに設定
3.  pod installのやり直し

しかし、Xcodeを確認するとすでに対応済みでした。

## **プロジェクト名.xcworkspace削除で解決**

Podfile.lock ファイル、Pods ディレクトリは削除して`pod install`していたのですが、`プロジェクト名.xcworkspace`も削除しなければいけなかったようです。

再度、コマンドを再実行します。

```shell
% sudo gem install cocoapods
% rm Podfile.lock
% pod install --repo-update
% fvm flutter clean && fvm flutter pub get
```

コマンドが正常終了したら、再度 Xcode でプロジェクトを開き、ビルドを試すとエラーは消えてビルド成功しました！
