Cocoapods use_frameworks! issue - ios

I found out that the way to resolve an issue, in a library i'm using, is to add use_frameworks! to the podfile. When i run pod install on the terminal, i get the following error:
[!] Invalid Podfile file: undefined method `use_frameworks!' for #.
Updating CocoaPods might fix the issue.
I'm using Cocoapods so i don't understand this issue. This tag is required for projects using swift, i'm using objective-c.

Looks to me like the second part of that error message:
Updating CocoaPods might fix the issue.
Is your issue. use_frameworks! was added in CocoaPods 0.36.0 which was just released recently.
Use pod --version to see what you're currently running. Assuming it's earlier than 0.36.0 you'll need to update it with
[sudo] gem install cocoapods
Which is just the same way you originally installed it.

I had the same issue when trying to run pod install on my mac.
So incase anyone encounters this issue what worked for me was changing the current ruby version with rvm.
On console, Use rvm list to see what versions you have installed:
So the version of ruby that was running on my mac was ruby-2.1.2.
I changed it with:
rvm use ruby-2.2.2
and ran pod install again and it worked.

Related

Facing issue while trying to init the pods on project

I hope you all are doing well.
I'm facing issue while trying to init the pod in the project. Cocoapods is already installed in the system. XCode Dev intstall is also there, In XCode in command line the xcode version is also selected. Don't know what I'm missing. I have MacOS BigSur.
If I run pod --version command on terminal it gives me version of 1.8.4.
I'm attaching the screenshot if someone has faced this issue.
I have the same issue. I solved it by following these steps:
First uninstall cocoapods with the command:
brew uninstall cocoapods
Reinstall Cocoapods:
sudo gem install cocoapods

How to find if cocoaPods is installed in my mac

Can anyone help to find if cocoaPod is installed in my machine. I was trying to use Google Map in my application. So i was asked to install CocoaPods. Could any one help me explain me the purpose.
try to find pod version by running this in terminal
pod --version
If command not found then you didn't installed
To install cocoapods
sudo gem install cocoapods
Reference : https://cocoapods.org
Solution found: Initially the Cocoapods has to be installed using the command sudo gem install cocoapods (I had some problem with proxies so it dint work for me initially and i resolved it).
To find if Cocoapods is installed or not run cmd (pod --version). if theresult is (Not Found) Pods is not installed. Please check for the internet connection and their proxies, these things took me huge time.
Enter this line and see if you get error:
pod search realm

Restkit has suddenly stopped compiling today

I am using RestKit in my project since a long time, using CocoaPods.
Podfile:pod 'RestKit', '~> 0.26.0'
Today, for unknown reasons, my project doesn't compile anymore. To the best of my knowledge, i have not changed any project settings or anything.
I get the error in RKObjectManager.h:
/projects/iphone/Pods/Headers/Public/RestKit/Network/RKObjectManager.h:892:49:
Unknown type name 'AFNetworkReachabilityStatus'; did you mean 'SCNetworkReachabilityFlags'?
If i go into the h.file and click on the ReachabilityStatusEnum, i can see it, so it seems to be there although it says 'Unknown Type'.
I am at a loss as to how fix this. I followed the RestKit cocoapods instructions when i set it up a long time ago. Could it be because i upgraded xcode recently?
Very thankful for pointers...
This seems to be an issue with RestKit and cocoapods 1.0.1 (maybe also 1.0). What I did was install version 0.39 which I had used before.
sudo gem install cocoapods -v 0.39.0
and then use this Version to install
pod _0.39.0_ install
solved the problem for me at least for the time being.
OK, so in the end, i had to add this to the .pch file. I have never had it there, and my project has built for over a year without it. Would be great to know why i suddenly had to include it...
#if __IPHONE_OS_VERSION_MIN_REQUIRED
#import <SystemConfiguration/SystemConfiguration.h>
#import <MobileCoreServices/MobileCoreServices.h>
#else
#import <SystemConfiguration/SystemConfiguration.h>
#import <CoreServices/CoreServices.h>
#endif
Had the same issue. You should use pre 1.0 versions of CocoaPods. If you have already the newer version installed pod --version do the following steps:
Install 0.39.0 version of CocoaPods sudo gem install cocoapods -v 0.39.0
Setup it with pod _0.39.0_ setup
Check whether it worked well with pod _0.39.0_ --version
You should see 0.39.0.
NOTE: in certain cases you will see that the version of pod _0.39.0_ --version is still the same newer version that you are trying to override. In this case you have to use - sudo gem uninstall cocoapods, then from the menu you will see in Terminal uninstall the newer version and finally get pod _0.39.0_ --version returning you exactly 0.39.0.
Now you can run pod install as usual.
Do not forget to switch back to the actual version later :)
This problem happened to me today.
SOLVED: Just change your Podfile from 0.26.0 to this:
Podfile:pod 'RestKit', '~> 0.27.0'
and then, on terminal, run:
{your_machine}$ pod install
Now working for me :D

Ignore compilation warnings when using CocoaPods in Swift

First of all:
inhibit_all_warnings!
do not work for Pods written in Swift, like Alamofire. It works only for other Pods, written in Objective-C. How do I block all the warnings?
UPDATE:
This has been fixed in CocoaPods version 1.0.0.beta.1.
There is no workaround to fix it. It's a CocoaPods known issue and they are working on it, said Alamofire : https://github.com/Alamofire/Alamofire/issues/937
When it will be fixed, you will just have to update CocoaPods by simply install again your gem:
$ [sudo] gem install cocoapods

Installing Realm via CocoaPods

I am trying to install Realm (Objective C) via Cocoapods.
However I keep getting the following error:
Pods/Realm/Realm/module.modulemap:1:18: Redefinition of module 'Realm'
Has anyone faced this problem?
I've tried downloading their CocoapodsExample project but I get the same error.
This is a known issue with CocoaPods 0.38.1, being tracked at https://github.com/CocoaPods/CocoaPods/issues/3886. In the meantime, you can gem install cocoapods -v 0.38.0 and run pod _0.38.0_ install to use CocoaPods 0.38.0, which does not have this issue.
This should now be fixed in CocoaPods 0.38.2.

Resources