I'm trying to run pod install in vain :
Analyzing dependencies
Creating shallow clone of spec repo `master` from `https://github.com/CocoaPods/Specs.git`
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master`.
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.
I think i have a proxy issue, but i don't know how to fix it. These is the result when i try pod setup
Setting up CocoaPods master repo
[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --depth=1
Cloning into 'master'...
fatal: unable to access 'https://github.com/CocoaPods/Specs.git/':Received HTTP code 503 from proxy after CONNECT
It is possible, that your system proxy settings do not apply to the bash. Type this into bash before running pod install:
export http_proxy=<YOUR_HTTP_PROXY>
export https_proxy=<YOUR_HTTPS_PROXY>
If it helps, you can make proxy settings load when bash starts by adding above commands to the .bash_profile (create file if it does not exist) in your home directory.
I think you forgott to set your newly install Xcode on Command-linetool path location. please check that on Xcode-->Preferences-->Locations-->Command line tool --> set your Xcode.
Firstly, I think you need to config your own cocoapods dependencies manager using http_proxy variable
Step 1: Config your proxy setting for both of http and https at current project directory:
export http_proxy=username:password#proxy_server_ip:proxy_port
export https_proxy=username:password#proxy_server_ip:proxy_port
You can use the following command to show proxy settings:
echo $http_proxy
Step 2: Install cocoapods with http_proxy variable already defined before
sudo gem install cocoapods -p $http_proxy
Finally: Install your own pod libs
pod install
These worked for me.
Related
I've just set up my app to be built on the App Center, by following the article here.
Although the Android version builds and deploys fine on App Center, I'm getting an error with the iOS build, shown in the excerpt from the build output below:
==============================================================================
Task : CocoaPods
Description : Install CocoaPods dependencies for Swift and Objective-C Cocoa projects
Version : 0.151.1
Author : Microsoft Corporation
Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/package/cocoapods
==============================================================================
[command]/usr/local/lib/ruby/gems/2.6.0/bin/pod --version
1.9.1
[command]/usr/local/lib/ruby/gems/2.6.0/bin/pod install --repo-update
[!] Invalid `Podfile` file: Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first.
# from /Users/runner/runners/2.165.2/work/1/s/bdstories/ios/Podfile:51
# -------------------------------------------
# unless File.exist?(generated_xcode_build_settings_path)
> raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
# end
# -------------------------------------------
##[error]The process '/usr/local/lib/ruby/gems/2.6.0/bin/pod' failed with exit code 1
##[error]The 'pod' command failed with error: The process '/usr/local/lib/ruby/gems/2.6.0/bin/pod' failed with exit code 1
##[section]Finishing: Pod install
##[section]Starting: Xcode build (signed)
My build script is:
#!/usr/bin/env bash
# Place this script in project/ios/.
# Fail if any command fails.
set -e
# Debug log.
set -x
cd ..
git clone -b beta https://github.com/flutter/flutter.git
export PATH=`pwd`/flutter/bin:$PATH
flutter channel beta
flutter doctor
echo "Installed flutter to `pwd`/flutter"
# Build the app.
flutter build ios --release --no-codesign
I did add the flutter pub get as mentioned in the error, but that didn't make a difference. Also worth noting that the build works fine when I do it in Xcode locally. I can also deploy the built archive to Testflight with no problems. It's just the App Center build process I'm having issues with.
I'm a bit lost now and I can't find any information on how to resolve this. I'm also new to CI/CD, so any help appreciated!
Update
I've also tried adding the following to the script to force App Center to run the same version of Cocoapods as my local machine, but it didn't make a difference to the error.
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 1.9.1
pod setup
I did this to my post-clone script and it worked:
#!/usr/bin/env bash
#Place this script in project/ios/
echo "Uninstalling all CocoaPods versions"
sudo gem uninstall cocoapods --all --executables
COCOAPODS_VER=`sed -n -e 's/^COCOAPODS: \([0-9.]*\)/\1/p' Podfile.lock`
echo "Installing CocoaPods version $COCOAPODS_VER"
sudo gem install cocoapods -v $COCOAPODS_VER
# fail if any command fails
set -e
# debug log
set -x
pod setup
cd ..
git clone -b beta https://github.com/flutter/flutter.git
export PATH=`pwd`/flutter/bin:$PATH
flutter channel master
flutter doctor
flutter pub get
echo "Installed flutter to `pwd`/flutter"
flutter build ios --release --no-codesign
The trick seems to have been moving the "fail if any command fails" section to after the pod re-installation
I had the same issue. It happens when the appcenter-post-clone.sh fails to run, so, the flutter is not installed and the command flutter build ios does not run to generate the Generated.xcconfig.
To fix it, I just:
Deleted the appcenter-post-clone and pushed this commit
Opened the configuration of the branch, on Build section. Now the post-clone tag has gone. Save it.
Push another commit with the appcenter-post-clone.sh again.
Configure the branch again, now with the post-clone tag back.
Save & Build.
Check your .gitIgnore. Had the same issue due to the file being excluded from the repo.
Once added back everything went fine.
Be also careful on the Paths defined for Flutter in your project.
1- Navigate to the flutter module directory
2- Do a flutter pub get
** Also make sure that you are on the stable channel "Flutter"
It appears to work now. I think there's been an update to the App Center build process.
For your info, I've included my final post-build script below, in case this is useful:
#!/usr/bin/env bash
#Place this script in project/ios/
# fail if any command fails
set -e
# debug log
set -x
cd ..
git clone -b beta https://github.com/flutter/flutter.git
export PATH=`pwd`/flutter/bin:$PATH
flutter channel beta
flutter doctor
echo "Installed flutter to `pwd`/flutter"
flutter build ios --release --no-codesign
I encountered the same issue after I copied an existing build profile from another branch. The problem was resolved after deleting the build config and creating a new one from scratch for the target branch.
Try to enter the IOS folder then pod installor
pod update
in the terminal
I have installed Fabric and Crashlytics in my application using Cocoapods. I got an error while running the application and error message is given below.
Error :
/project-path/Pods/Fabric/run: Permission denied
I have fixed the issue and steps for the same is given below.
Open terminal and in your project go to the folder where fabric framework exist.if you are using pods then fabric will be inside pod folder (Command:- cd project-path/Pods).
Run below commands in terminal once you have reached the corresponding folder path.
chmod +x Fabric/run
chmod +x Fabric/uploadDSYM
Run the below commands, once you have reached the root folder (Command:- cd ..)
pod deintegrate
pod install
Updated shell script with pods root path with fabric key which will generated while installing fabric signup in build Phase as shown below:
Refer Distribute Beta Builds and Distribute with iOS Build Tools
${SOURCE_ROOT}/Crashlytics.framework/submit <API_KEY> <BUILD_SECRET>
:
After moving to mac os sierra, I completely formatted my mac now I'm facing problem to install cocoapods, every time I run sudo gem install cocoapods --pre
every thing installed well, and when I try to install a pod, the terminal stack on Setting up CocoaPods master repo
.
Already updated the system with sudo gem update --system and still got the same problem, searched online to found old answers to use pod install --verbose
Ss I found in THIS answer fail again tells to install it manually.
NOTE : I have the latest version of 'Command Line Tools'. Any suggestion or how to install master repo manually?
From https://stackoverflow.com/a/21852985/1033581:
on 4th Nov 2016, the repo is 1.07 GB
From https://stackoverflow.com/a/33699136/1033581:
To get a progression, you can clone master yourself:
pod repo remove master
git clone https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master
pod setup
In my first installation, I got the same problem too, it takes too much time in "setting up master repo".
Actually, you can see it through "activity monitor" that it's actually downloading, but it seems the connection is slow from the server.
Try these steps, it solves my problem:
1. pod setup
It will do "setting up master" again, don't wait, continue these steps below:
2. Ctrl +C
3. pod repo remove master
4. cd ~/.cocoapods/repos
5. git clone --depth 1 https://github.com/CocoaPods/Specs.git master
It takes less than 7 minutes for me (I think it depends on internet connection), then I can do pod install.
Previously I am getting another error to resolve that I removed master repo and after that trying to install pods and I am getting below error. I checked other options also but they are not working for me.
Mys-MacBook-Pro:~ user$ pod setup
Setting up CocoaPods master repo
[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --depth=1
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist, use `xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools (or see `man xcode-select`)
please let me know what to do here.
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"