The sandbox is not in sync with the Podfile.lock-ios

大兔子大兔子 提交于 2019-11-27 20:32:39
Tharif

Run 'pod install' or update your CocoaPods installation.

You have answer in the error itself !

The error message states that you should update your CocoaPods installation.

You could remove libPods in frameworks and libraries and update Cocoapods using pod install.

Also:

clean and build the project

SO references :

CocoaPods Errors on Project Build

Error:"The sandbox is not in sync with the Podfile.lock..." after installing RestKit with cocoapods

For me, it works after the following:

pod deintegrate --verbose    
pod install --verbose
Arthur Kazemi

For me, the reason was missign User-Defined variables in the Build Settings!

Looking into the issue, the Build Phases tries to diff 2 files.

diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null

Just because of missing PODS_PODFILE_DIR_PATH and PODS_ROOT variables, assumes them as "" so ${PODS_PODFILE_DIR_PATH}/Podfile.lock points to /Podfile.lock and same for the other one.
So it fails in

diff /Podfile.lock and /Manifest.lock

I fixed this by adding 2 User-Defined settings to the Build Settings

PODS_ROOT = ${SRCROOT}/Pods
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.

After hours of searching this is the only solution that worked for me

Deleting the derived data did the trick for me . I deleted by going into the finder itself.

Make changes in the podfile as given below:

Older pod file

target :TargetName, :exclusive => true do

Changed pod file

target 'TargetName' do

Sudhir Mann

Just go to Build phases and click on [CP]check Pods Manifest.lock.

diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null

Both PODS_PODFILE_DIR_PATH and POD_ROOT should define in user-Defined in build settings. POD_ROOT should have correct path to Manifext.lock file and POD_PODFILE_DIR_PATH should have correct path for Podfile.lock

So Add below in build settings.

PODS_ROOT ---- ${SRCROOT}/Pods

PODS_PODFILE_DIR_PATH ---- ${SRCROOT}

The problem is Podfile.lock and Manifest.lock cannot be found by the Check Pods Manifest.lock Script in your targets build phase.

This is usually caused by PODS_PODFILE_DIR_PATH and PODS_ROOT variables not being defined.

Go to build settings tab to define them.

You will need to look for Podfile.lock and Manifest.lock in your project and get the the full paths of their directories. The directory paths will be the values you use for PODS_PODFILE_DIR_PATH and PODS_ROOT.

Randika Vishman

I'm pretty sure that you have opened your Projects' workspace which you try to install new Pods. So try out the following (for me this worked):

  1. Clean the project
  2. Close the project
  3. Run pod install
  4. Open the project and try re-building it once more

Problem might have been resolved.

Burak Öztürk

In my case, I got same error after integrating my other targets. To solve problem I needed to add both targets in Podfile:

abstract_target 'myApp' do
   use_frameworks!

   pod 'Alamofire', '~> 3.0'
   pod 'SwiftyJSON'

    target 'myAppOtherTarget'
end

Make sure you add a "pod install" command line build step, before the Xcode Project build step.

The error is coming from the build phase run script in your Xcode project's target, which is unable to find Podfile.lock. This file is generated by CocoaPods, which must be installed in a build step in your TeamCity project.

My build steps look like:

  1. Command line: bundle install --path .bundle (installs cocoapods local to the project using Gemfile).
  2. Command line: bundle exec pod install --verbose (uses Podfile)
  3. Command line: carthage update --platform iOS (uses Cartfile)
  4. Xcode Project
  5. Command line to build an archive
  6. Command line to upload a build

Hope this helps.

In my case, the errors were occurring on a _Tests target. I didn't need the _Tests target, and so I deleted it. This resolved the error.

Manish

This happens if cocoa pods don't install or uninstall properly

If you want to install cocoa pods run

pod install

if you you want to uninstall cocoa pods then run command

pod deintegrate

I had the same issue. Turned out the cocoapods version on Manifest.lock was higher than what I had on my mac. I had to do a 'sudo gem install cocoapods', to get the version of the cocoapods upto what was specified on the Manifest.lock file. This fixed the issue and I had no errors on building the project.

Im facing the same issue now and fixed using this command after navigating to project location in terminal.

pod install --repo-update

If you happen to move your Podfile like i did and face this issue, the solution discussed below may help -

  1. Delete all of the following - Pods folder, xcworkspace file, podlock file (skip the ones that are not available for subfolders)
  2. delete all steps that has [cp] in it from the build phase tab
  3. repeat step 1 & 2 for all the sub projects that you have in your workspace
  4. open workspace, go into each project and delete framework for pods, and delete the pods folder from each project
  5. close workspace
  6. run pod install

you should now be able to open, build and run the project

Fabio Valencio

I fixed this by adding 2 User-Defined settings to the Build Settings

PODS_ROOT = ${SRCROOT}/Pods
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.

I had been searching for hours and I found solutions as follow:

In my case, method 3 works.

Method 1:

  1. choose the target > go to Build Phrases > click Link Binary With Libraries > remove all libPods.a files
  2. open Terminal > direct to your project > run:

     pod install
    
  3. clean and build project

ref.1

Method 2:

  1. open Terminal > direct to your project > run:

    pod deintegrate --verbose    
    pod install --verbose
    

ref.2

Method 3:

  1. choose the target > go to Build Settings > click "+" sign
  2. add 2 User-Defined Settings: [to the left = to the right]

    PODS_ROOT = ${SRCROOT}/Pods
    

    and

    PODS_PODFILE_DIR_PATH = ${SRCROOT}/
    

ref.3

I just fixed it by updating the Cocoapod, cause before the error there was log where the warning shows we need to upgrade our cocoapods as the pod files are not supported by the current cocoapod version, So clean the project , upgrade cocoapod then install pod.

1. Clean project
2. sudo gem install cocoapods/gem install cocoapods
3. pod install (optional if your project still shows error)

Note: I found this error for my flutter application in iOS platform

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!