Ignore compilation warnings when using CocoaPods in Swift - ios

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

Related

Cannot install Cocoapods on M1 Chip

I am working on a Mac, M1 chip. I was working in React Native, when something happened with my system's configurations while trying to get the Android Build to work. No npm, npx, (any node commands really) worked, I couldn't do anything with my Pods, and essentially just everything was broken. I deleted and uninstalled everything to do with Node, Java, and Cocoapods but the issue I'm facing now is that I cannot install CocoaPods
I am following the directions from here and I am on my third try to just start a new React App. The Project will build, but I cannot install any pods and the whole app seems to not know that its supposed to be running off React as it won't let me use imported components.
So I have a plethora of issues in front of me, but the biggest is my inability to install CocoaPods.
I run...
brew install CocoaPods
and get the following return...
Warning: cocoapods 1.11.3 is already installed and up-to-date.
But upon running npx react-native init I get the following error...
error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
So I tried as I was instructed, and attempted to run...
sudo arch -x86_64 gem install ffi
Which gives me this...
make install failed, exit code 2
And since that fails, I cannot successfully run...
arch -x86_64 pod install
So it looks like my code is breaking before I can even type a single line. I've been trying to just create a new React Project for hours now... this seems very overly complicated
Update your ruby to recent version, for that you can use rbenv via homebrew. After that install cocoapods via gem install
There must have been some sort of corruption or only partially installed dependency. I ended up wiping my hard drive and restoring everything, it worked after that

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

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.

Cocoapods use_frameworks! issue

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.

Resources