Pod update error on m1 (realm certificate) - ios

I'm trying to run a project on a mac with m1. Installed brew and quietly installed cocoapods. There are only two pods in the project - Realm Swift and Revenue Act.
When installing Realm Swift, the following error occurs:
RevenueCat was installed without any problems. What could be the problem?
Below in duplicate for convenience
Update all pods
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Installing Realm (10.33.0)
[!] /bin/bash -c
set -e
sh scripts/setup-cocoapods.sh
Downloading dependency: 12.13.0 from https://static.realm.io/downloads/core/realm-monorepo-xcframework-v12.13.0.tar.xz
Downloading core failed:
https://static.realm.io/downloads/core/realm-monorepo-xcframework-v12.13.0.tar.xz
curl: (60) SSL certificate problem: certificate has expired
More details here: https://curl.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

The problem was solved after I entered this command into the terminal:
echo insecure >> ~/.curlrc
The information is taken from this answer.

Related

XCode Swift package manager error behind proxy

We use Swift package manager embedded in XCode for the dependencies in our project. Everything works fine when using it on the local machine. However when I try to build the project on our ci slaves I get the following error (when run from both XCode and the console) :
xcodebuild -resolvePackageDependencies
Resolve Package Graph
Fetching https://github.com/hmlongco/Resolver.git
xcodebuild: error: Could not resolve package dependencies:
An unknown error occurred
The difference between running it locally and on the ci slave is that the ci machines are configured behind a proxy. We already whitelisted all the URLs that were accessed when running this command, however the problem still persists. I couldn't find any detailed log about this error.
From examining the network packages sent when I run the command we can still see that some app is trying to access the direct URL instead of going through the proxy and here timeout is received. We only use public packages on github and there isn't any authentication needed.
From other side if the project is set up the old way using Package.swift and we run:
swift package resolve the dependencies are successfully resolved without errors.
I have already gone through the following but there wasn't any helpful solution:
Configuration for enterprise networks
XCode proxy settings
SPM in real life projects
Same issue on developer forum
SSH error resolving dependencies - no ssh dependencies
Also there isn't any documentation about how resolving the packages through XCode is different than using 'swift package'.
Currently I'm not sure whether it's possible to configure something so XCode uses the proxy settings for SPM or the Xcode SPM through proxy is just not supported. Any ideas? Any help is appreciated!
From what I just found, at least for Xcode 12.4, there's -scmProvider option for xcodebuild:
-scmProvider which implementation to use for Git operations (system/xcode)
If I guess it correctly, -scmProvider system would force xcodebuild use "system" git. That, in turn, in my case, makes it respect the git config settings I have, particularly proxies.
Hence, answering the original question, it's probably worth trying
xcodebuild -resolvePackageDependencies -scmProvider system
(as long as Git config is properly set up)
Turns out there was an easy fix if we just configure the proxy for using it with git:
Getting Git to work with a proxy server - fails with "Request timed out"

Cocoapods cannot install Trunk

I'm trying to develop a React Native mobile app for iOS on Windows 10. Using the react native cli, I've generated a RN iOS project with the standard file structure, including a "Podfile" file with the default RN pods.
However, when I try to use "pod install" in order to add other pods of my own, I get the following error code:
[!] CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/CocoaPods-version.yml Response: SSL peer certificate or SSH remote key was not OK
I've been googling this error but I've run into a dead end. I've tried using pod update, I've changed my cURL version, I've gone over the setup instructions for Ruby, curl, and others, and I'm at a loss. What can I do?
Note: I haven't run the app yet, and am trying to install the react-native-mapbox-gl pod first, but I can't even properly install Trunk.
cURL Version:7.70.0
CocoaPods Version: 1.9.3
You won't be able to develop for iOS on Windows – because the iOS SDK and build tools are only available on macOS. No way to legally do it without an access to an Apple computer.
You can try Expo though – it doesn't require macOS for development, but keep in mind that you will be limited to the APIs Expo provides.
As for the actual error – it seems that the CocoaPods rubygem has not been tested on Windows at all, and is likely invoking curl in a way that doesn't account for Windows's SSL certificate management system.

Newbie: Unable to Install Homebrew on MacOS

I have been having certain issues while trying to setup my Mac (OS:Catalina) for a React Native Development.
I have read multiple guides and tutorials as I am facing issues initializing a react native build (react-native init). I keep getting err lifecycle validation
Multiple articles suggest to download Homebrew and it might solve a lot of the issues related to package folders for node etc.
When I try installing Homebrew using the below link -
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
I get a message on my terminal :
Curl: (7) Couldn't connect to server.
If I try to type in the address on the browser, I get the installation code which I saved on the Mac storage as install.rb
Entering '/usr/bin/Ruby install' throws a prompt that the folder doesn't exist.
I already have Xcode and Xcode Command Line Tools installed.
I would appreciate any help I can get on how I can just prepare my system for learning react native development for iOS.
I am at a bit of 'no clue what I am doing wrong' phase.
Try this command on terminal
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Cocoapods update GoogleAnalytics sdk returns an SSL certificate error

Ive just upgraded to version 0.37.1 of CocoaPods and now Im getting an error when trying to update my GoogleAnalytics library
In my podfile I have
pod 'GoogleAnalytics-iOS-SDK'
And now when I execute
pod update
I get the following error
[!] Error installing GoogleAnalytics-iOS-SDK [!] /opt/local/bin/curl
-f -L -o /var/folders/v_/g79mcljx083bf8rp289mdy7r0000gq/T/d20150527-85393-io5rvl/file.zip
https://dl.google.com/googleanalyticsservices/GoogleAnalyticsServicesiOS_3.12.zip
--create-dirs
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:--
--:--:-- 0curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: http://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a
"bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
Ive tried changing my podfile to use this pod but same error
pod 'GoogleAnalytics'
Anyone know whats causing this? Is is related to the v0.37.1 update or an issue with the pods source?
You might have something wrong with your curl itself and its ssl.
I had the same problem installing Google-Maps-iOS-SDK with cocoapods and the solution was to remove and install curl again.
If you're using brew, then it's just:
brew uninstall curl
brew install curl
brew link curl --force
Cocoapods v0.37.2 is now available, try that!
Else you might try this :
install rvm if needed (https://rvm.io/rvm/install)
So, in a console :
rvm osx-ssl-certs update all
pod setup --force
pod install --verbose
This works for me, but i don't know which step was the workaround.

Cocoapods, fail to use pod setup and pod install

I have problem in setting up Cocoapods using command pod setup, with an error say SSLRead() fail. I have found a workaround in downloading the Specs of Cocoapods manually. However, when I need to install the library using command pod install in my project directory, problems regarding to SSL remains. The returns are as below:
Downloading dependencies
Installing AFNetworking (2.2.1)
[!] Error installing AFNetworking
[!] /usr/bin/git clone https://github.com/AFNetworking/AFNetworking.git/Users/DavisChung/Documents/Programming/Xcode\ Projects/TapBit/Pods/AFNetworking --single-branch --depth 1 --branch 2.2.1
Cloning into '/Users/DavisChung/Documents/Programming/Xcode Projects/TapBit/Pods/AFNetworking'...
fatal: unable to access 'https://github.com/AFNetworking/AFNetworking.git/': Server aborted the SSL handshake
One for all, how can I resolve the problems regarding to SSL?
My mac OS version is Yosemite 10.10.2
Thanks
After having the same issue, I have realized that my network provider decides to randomly check if I am human. There might be another solution, but when running from terminal, There is no additional way to response. Therefore, the network provider is that one that might cause the issue.
To that my solution was to change network, then re-run pod install. The pods did updated once I did.
it seems that your network working under proxy.For this case you need download project from github point this directory inside the podfile
pod 'MyPod', :local => "/Path/To/Pod"

Resources