CocoaPods pod install. Modules cannot be imported - ios

I installed CocoaPods by using $ sudo gem install cocoapods.
I have a swift Xcode project with the following podfile
platform :ios, '8.2'
use_frameworks!
target 'Clover' do
pod 'Alamofire', '~> 1.2'
pod 'SwiftyJSON', '~> 2.2'
pod 'ObjectMapper', '~> 0.12'
pod 'ImageLoader', '~> 0.3.0'
pod 'SVProgressHUD'
end
target 'CloverTests' do
end
After I run pod install, which seems to run correct with no error messages, I have a Pods folder generated with Pods.xcodeproject along with several other files.
However, when attempting to compile the project, I will into errors telling me my modules are not found. The error message is No such module followed by the module name.
I then attempted to install the modules manually and confirmed that the pods are indeed not working as each module after its manual installation, works.
I have searched and attempted several solutions as follows:
Deleted and reinstall pod.
Upgraded ruby to 2.2.1
Delete the pods folder and re-run $ pods install.
Clean the project.

More a comment than an answer, but I don't have enough reputation to comment:
When you use pod install with your-project.xcodeproject, it creates a new file/folder named your-project.xcodeworkspace (…project becomes …workspace) and this is this new file that you should open.
You didn't mention whether or not you knew that, so here you go: close the .xcodeproject in Xcode and open the .xcodeworkspace instead and it should work.

Related

CocoaPods could not find compatible versions for pod "Firebase/Crashlytics"

I am developing react-native app.
I followed the firebase instruction adding my iOS app to my firebase project.
In my Podfile, I have:
pod 'Firebase/Crashlytics'
pod 'Firebase/Analytics'
when I run pod install I keep getting the error saying "CocoaPods could not find compatible versions for pod "Firebase/Crashlytics".
Xcode version 11.7, target iOS10.1
Why I get that error and how to get rid of it?
(I tried run pod update 'Firebase', I get:
[!] The Firebase Pod is not installed and cannot be update)
Make sure that your project's minimum deployment target (the one that referenced in your Podfile) is at least iOS 9 (see Firebase/Crashlytics release notes)
Unfortunately when cocoapods initially create the Podfile, doesn't take into account your projects minimum deployment target. Instead adds a default value in a comment.
The first time that you run pod install you will get a warning about not specified minimum deployment target. Also cocoapods documentation doesn't mention anything regarding this behavior.
So, you have to have to manually edit your Podfile and add something like this:
platform :ios, '10.1'
No issue with the deployment target but got the same error. It was working with the following versions of Firebase
pod 'Firebase/Core', '~> 3.0.0'
pod 'Firebase/Crashlytics', '~> 7.0.0'
When I added a new dependency and run pod install, It was showing the error for Firebase. So, I used the >= 0 in place of the version.
pod 'Firebase/Core', '>= 0'
pod 'FirebaseCrashlytics', '>= 0'
This will install the latest version for all Firebase dependencies.

cocoa pod install error while want to install afnetworking pod

$ pod install
Updating local specs repositories
Analyzing dependencies
[!] Unable to find the Xcode project
`~/Desktop/TestAfnetwork.xcodeproj` for the target `Pods`.
When i run install command then i got this issue.Please solve my problem. I have already updated this setup.
Firstly, you should cd to your path /Users/vallesoft/Desktop/TestAfnetwork by using Terminal.
Secondly, type pod init to create Pod file
Finally, make sure that your Pod file look like this
target 'TestAfnetwork' do
pod 'AFNetworking', '~> 2.6'
end
Good luck

Issue with importing framework in Swift with Cocoapods

I am new to Swift, but I learned the basics. I wanted to import a framework but I ran into issues. I will now explain what steps I followed and what failed.
I installed cocoapods by using terminal command: sudo gem install cocoapods
I then navigated to my projects root directory with terminal then used command: pod init
It created a podfile, and I edited it as I have shown below.
platform :ios, '8.0'
use_frameworks!
target 'Testy' do
end
target 'TestyTests' do
pod 'Kingfisher', '~> 1.8.1'
end
target 'TestyUITests' do
pod 'Kingfisher', '~> 1.8.1'
end
I then closed xcode and started the project by clicking 'Testy.xcworkspace' file.
At this point, I did not add any code, just built the project without issues, problems start here.
When i try to import my framework and build, it gives the follow error:
Cannot load underlying module for 'Kingfisher'
So what might be the problem here? If you need additional info, ask me and I can provide.
In your Podfile, you do not have "pod 'Kingfisher', '~> 1.8.1'" listed for the target "Testy".

Unable to install Parse package via Cocoapods. Missing library

Senario:
I'm studying parse.com inter-table relationship via code.
I've set up a cocoapod dependency and am working from the .workspace.
This is the podfile content:
platform :ios
pod 'Parse', '~> 1.7.2.1'
However I received the following compiler error:
Apparently I'm missing a Library.
What am I doing wrong?
Try rerunning pod update from the project folder via the command line, then cleaning your build.
Also, you don't need to be quite to specific with your podfile. Try this instead:
platform :ios
pod 'Parse', '~> 1.7'

the file tidy.h and buffio.h not found

I am developing app using CXFeedParser. But after doing all the integration,
The File "MWImageParser.m" is generating error.
# import "tidy.h" and "buffio.h" not found
buffio.h and tidy.h is a part of TidyLib.
Simple solution is to include its source in your project (see include and src folder).
Other solution is to include a cocoapod tidy-html5 (seems to be experimental, so be careful). There is a cocoapod for MWFeedParser too.
Check the Cocoapods website for more information (if you still need).
Basically, after installation (via sudo gem install cocoapods), you need to create the following Podfile in your project root, with the following content:
pod 'MWFeedParser', '~> 1.0'
pod 'tidy-html5', '~> 0.0'
Then run pod install and open the generated xcworkspace.
Note: only Podfile and Podfile.lock should be added to source control. The Pods directory can be ignored.
Edit: You are using CXFeedParser. If you look at the CXFeedParser podspec, you'll see it has a dependency with CTidy. So remove MWFeedParser from your project and have the following Podfile:
pod 'MWFeedParser', '~> 1.0'
pod 'CTidy', '~> 0.3'
There is very simply way i have found, no need to do any pod setup, just download the Tidy.h and Buffio.h from GIT Hub and include in Your project, and it will run smoothly..
Finally solved my own question.

Resources