I was trying to make a demo project which uses a POD dependency of this URL PageMenu POD install correctly but gives me many errors on building this dummy app as many methods' are renamed in latest iOS SDK and swift 4.2. I have solved this problem before on my office project but can't remember right now. Any help will be appreciable. I am attaching a screenshot with this project.
Reasons for the problem: Swift version of my project is 4.2 and I am using a library which was built in swift version 4. So some of the method's name in latest iOS SDK is renamed from Swift 4.
Solution: I need to set Swift version 4 for that pod dependency and recompile this project.
Note: Any third party pod that doesn't support the latest swift must be compiled with the supported version of swift for pod dependency
Related
I am trying to install a Pod in my IOS/iPhone project using Xcode 9.3.1.
My target app is configured to use Swift 3.3.
After adding the following line to my podfile...
pod 'Concorde'
I ran...
pod install
The pod installed normally. However, upon compilation, I receive a mess of compiler warnings and errors like "NSUrlResponse was obsoleted in Swift 3". It seems the Swift version I have (3.3) is too new.
The Swift version configured for the build target is also 3.3.
It looks like an older Swift is required for this Pod. However, is there a simple way to determine which Swift version is required for the pod?
I checked the CocoaPods.org web site and the page does not show the Swift version required for the library.
I also checked the podspec, where I expected to find that version number requirement.
You can try terminal command,
pod try "pod name"
this will clone the repo automatically for you to test the framework on the fly
there you can check out whatever you need.
Plus reading the description on GitHub helps too
Also i recommend using highly popular pods, as they tempt to be more stable.
read the reviews about the framework, and try to find other alternatives for it.
New update: You can try to preview .podspec file inside the Repo on github sometimes you can find the Swift Version of that Pod example : here
I have a Cocoa Touch framework file which I take out regularly from my codebase. It has some helper classes which I uses in some of my projects. It was doing good before the evolution of Xcode 9.0.
When I tried that framework in a project of Xcode 9 then it shows error that the module is compiled with Swift 3.1 so I compiled the whole classes using Swift 4 and tried to use that in a application, it still shows me the above mentioned error.
If I use the same project in Xcode 8.3.2 then it works well.
If the issue is in one of external libraries then their recompilation is required. For that one way is:
Deintegrate all the pods first:
pod deintegrate
Run pod install again:
pod install
Also, clean XCode Derived Data & clean up your project.
I have an iOS project written purely in Swift which uses CocoaPods for dependency management. In my Podfile I have the "use_frameworks!" keyword to inform CocoaPods that I want my dependencies as Swift dynamic frameworks.
Trying to integrate the Restcomm iOS SDK (which is written in ObjC) into my project, I have run into the following issue:
After adding the pod to my podfile and doing a "pod install", the workspace is updated and the pod is installed just fine. Although, the build fails with an error: Lexical or preprocessor issue: sofia-sip/sdp.h file not found. The sofia-sip-library is a dependency of the restcomm-ios-sdk itself.
For reference, I also created a new iOS project, now in ObjC, and installed the restcomm-ios-sdk without using frameworks. After that, the build runs just fine.
Seems like the issue is related to my project being in Swift and using dynamic frameworks, while the restcomm sdk is a static ObjC library.
I have tried to modify the Target / Build Settings / Header Search Paths, but it turns out using dynamic frameworks leaves my Pods/Headers folder empty.
Others have run into similar issues before:
https://github.com/CocoaPods/CocoaPods/issues/5330, https://github.com/CocoaPods/CocoaPods/issues/4605, https://github.com/CocoaPods/CocoaPods/issues/3839
Although, none of these threads offer a solution that would work for me. Any idea how I could go about solving the issue?
I have a running project which is working fine with pods. I had to copy this project to develop version-2. Now when I try to build project, I encounter following issue in pod's code. I tried removing this specific pod but same type of errors were shown in different pod.
tried all of this: https://guides.cocoapods.org/using/troubleshooting.html ,but it didn't help at all.
Being new to iOS development, I can't figure out, what I am doing wrong.
It seems like you are using the newer version of pod in older Xcode. So either you need to update your Xcode or downgrade your pod to the relevant version supporting Xcode. From image i can guess you might be using Xcode 7.2 or down and pod is in swift 2.3 or 3
According to this tutorial, we should add use_frameworks! to Podfile in Swift project. But how to use third-party code in .m in the same project?
One possible way is,
Do NOT add use_frameworks! to Podfile
Import header in ...-Bridging-Header.h
Then, I can use third-party code in both .swift and .m file
But when I try to import header in ...-Bridging-Header.h, it just throw *.h file not found error, how to fix this issue?
Past
Up to CocoaPods 1.4.x (included), it was NOT possible to use CocoaPods with Swift code without use_frameworks!.
Present: 1.x.x and above
Nowadays, with CocoaPods 1.x.x (I verified it with 1.4.0), it's common to use use_frameworks! for both Swift and ObjC projects: it allows for a mix of the two languages in any way you want without issues:
You'll be able to use a Swift dependency in an Objective-C project.
You'll be able to use an Objective-C dependency in a Swift project.
Present: 1.5.x and above
Nowadays, CocoaPods 1.5.0 supports integrating swift pods as static libraries. Try it (sudo gem install cocoapods) and enjoy removing use_frameworks! from your Podfile.
Note that for iOS:
Apple requires Xcode 10.1 minimum, which is only well supported starting CocoaPods 1.6.0, so don't bother using older versions of CocoaPods.
Apple will require Xcode 11 minimum in April 2020, for which I would only use CocoaPods 1.7.5 or newer, together with xcodeproj 1.13.0 or newer.