How to migrate manually added iOS thirdpart sdk to pod version - ios

We have two years old iOS app that needs to update recently.
There is an old SDK (2.0) that manually added to project. Now this SDK have 4.0 version on cocoapods and we really like to move this SDK to pod.
What is the best way to do it? just delete the library from Build Phase and pod install?
Changing the old code to support new SDK is not problem for me.

just delete the library from Build Phase and pod install?
Yes this would be the easiest way to go about it.
Also make sure you remove it from your local files inside the project so that Xcode cannot get confused, make sure you remove all remains of the pod (except the code ofcourse).

Related

Xcode 10 convert to Swift 4.2 fails

I am getting this error trying to migrate to Swift 4.2 using the Xcode provided conversion tool. How do I fix it? The code builds fine otherwise.
Do you have any libraries in your project? I think you are trying to covert your project with dependencies and there are problems in them with new swift version. Try to uncheck all dependencies except your project and convert to new version of Swift
I had similar problem, solved it by
1- Change swift lang version in build setting of all app and test targets to 4.2
2- build app, errors will happen like UIControlState renamed to UIControl.state
3- fix all of the build errors
4- I updated all recommended settings by xcode
5- then I asked xcode to convert to swift4.2
It's always a good idea to upgrade all dependencies (e.g. via Cocoapods) to its latest version that support Swift 4.2. In my case, I also need to manually change the Swift Language Version build settings for a pod library from Swift 4 to Swift 4.2 as that lib uses some APIs in 4.2 only.
I have problem too. I find solution to fix this problem in web
https://ericasadun.com/2018/09/13/converting-projects-by-hand-to-4-2/
First
You try delete pod in pod file and install pod again and pod update in your folder project in command then conversion to Swift 4.2.
if it's not work do this in second.
Second
you try follow do this picture in build setting project or try follow do in link web.
As described here,
There may have been issues with processing the targets that will
negatively impact the migration process. Switch to the Report
Navigator and select the Convert entry that was added; this is the
conversion build log. Check the log for errors that may have showed
up.
If you see errors about not being able to code-sign the target, try
disabling code-signing from the build settings of the target. If you
see other errors, please file a bug report and include the details.
You are strongly encouraged to attach a project that illustrates the
faulty migration if possible.

Issue with building project after addition of AFNetworking in Xcode 8

I just added AFNetworking in my project and have this problem.If you will say that I need to add a security.framework I will answer that I did it already.Here is screenshots. Problem screenshot
I have already added framework screenshot
On screenshot I see that you added Apple Security.framework, and problem is with AFNetworking framework. Are you sure that you added AFNetworking to your project. If it was also added - then next question comes:
Was CocoaPods used for this, or there was another source. CocoaPods should install newest version of framework but if framework is for example copied from older project - then it can cause many issues. For example framework may not support arm64 architecture.
So first attempt to solve this problem will be using fresh version of framework (using CocoaPods recommended), eventually check architectures supported by framework (see here).
Clean your build folder and run pod install.

Xcode Cocoapods Not Finding Framework Header Files

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.
There are two paths:
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.
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.

Cocoapod podspec to reference iOS and OSX projects

Are there any examples or suggestions on how to make a CocoaPod podspec that is used by both an iOS project and OSX project within a workspace? I'm working on a pod that uses bluetooth and I'm sure many will want both their OSX project and iOS project living in the same workspace referencing the same Pod.
There are several things I'm unsure about, such as changing the Base SDK between iOS and OSX, and how to make the project reference either an iOS or OSX target.
Anyways, any suggestions are welcome. Thanks in advance.
Thanks Keith. The correct answer is in the comments above. To see a sample go to github.com/PunchThrough/Bean-iOS-OSX-SDK/wiki

How to use cocoapods in an exist ios project

I have an ios project first made in Xcode4.6. I have update it to Xcode5.0.2. Now I want to change the project to using cocoapods to manage the third party pods.
Due to a newer to cocoapods.I search the Internet to how to install cocoapods and so on.Now it's OK.So I run the pod install to get "AFFnetworking 2.1.0". .xcworkspace generate successfully.Then I open the workspace.I saw this in the navigation
There are many question mark.I think this means that Xcode5.0.2 didn't know the AFNetworking 2.1.0 added by cocoapods. And If I write the "#import "AFNetworking.h" in a .m file. Xcode will say that can't find the "AFNetworking.h".
I am a newer to cocoapods. So home someone could help me. Tanks a lot.
Because AFNetworking is linked as a library you need to use the < > import style. So #import <AFNetworking/AFNetworking.h>.
The question marks are coming from your version-control system, not from Xcode itself; they indicate that the files added by CocoaPods are new to version control. I’d recommend committing all of the CocoaPods-related files right away so that you have just one commit that represents “moving to CocoaPods”.
I guess you are using git repository.Add files pod to repository, currently they are untracked thats the reason for '?' there.if the error persists then see the following discussion
AFNetworking Cause Error while using XCTest in Xcode5

Resources