0

So I am working on an old Xcode project that was developed by a separate developer and am having build errors when running on my Mac due to Cocoapods. The first error is "The sandbox is not in sync with the Podfile.lock”, which I can fix by removing the various Cocoapods files and the old xcworkspace from the project and running pod install in the terminal to create all of this again. The new issue is that some of the classes cannot find the header files from the podfile's listed frameworks.

My theory is because this is an old project and the old developer didn't put version caps on some of the frameworks in the podfile, is that the project is trying to use old methods / classes that are deprecated in the newest updated frameworks. However I am not sure how to get around this as I tried putting version caps on those frameworks in the podfile without any success.

1 Answer 1

2

There are two paths:

  1. You investigate each framework, estimate the approximate pod version that could have been used at the time project was active, and use particular version of each pod (you can find info on configuring pod version here This solution won't work in 90% of cases, however, as iOS is evolving really fast and old frameworks are most probably outdated and not compatible with latest changes.

  2. You investigate each framework and understand what actually changed. You look at headers that each pod has, understand what actually changed and implement changes in your code. You start with headers, making sure that you include the right ones, and then start migrating code to the newest versions. Big projects usually have migration guides.

There are no other options. As soon as any project becomes dependant on external code, it's up to developers to ensure that it's up-to-date.

Sign up to request clarification or add additional context in comments.

3 Comments

The first approach you posted was one of the methods I already tried unfortunately with little luck. Do you know why this approach fails so often? As I was under the impression that this was the main benefit of Cocoapods, being able to monitor and change the versions of each framework quickly and easily.
Yes, that's the benefit, but this actually requires some time to monitor changes (especially in big projects) on a regular basis, update integrations, understand the potential impact on the whole system. You miss few months and almost all frameworks will change and will require effort to adapt. This approach fails only because the more project is untouched, the more technical debt it has, and technical debt requires time resources to keep it rolling.
So am I right in thinking that if the previous developer had put version caps on all of the frameworks in the Podfile (so that the framework couldn't update beyond a specified version) then I probably wouldn't be having this problem?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.