Solves the problem that SwiftPM cannot cross the proxy and cannot add packages to the project

There was a phenomenon that SwiftPM could not cross the proxy and the package could not be added to the project, but I was able to solve it, so I will summarize it.

Note

This solution has been validated in my proxy environment, and the proxy environment varies from company to organization, so this solution may not apply to every environment.

environment

The phenomenon that occurred

--I did it according to "Add package to project with SwiftPM --Qiita", but after entering the repository path and pressing [Next] for a while Then it ends with an error. --Reviewing the mac proxy settings and the installed git and curl proxy settings does not help.

solution

As a result of the investigation, I found that for some reason, "Swift Package included as a dependency of the added Swift Package can exceed Proxy and can be installed".

In other words, you can solve it by ** "Create a Swift Package locally with the Swift Package you want to put as Dependency and add it to the project" **.

For how to add a local Swift Package, according to the leading SwiftPM developers, you can add it by dragging and dropping the directory into your project (https://forums.swift.org/t/how-to-add -local-swift-package-as-dependency / 26457/2)). Hopefully that's OK. That didn't work in my environment, so I added it using this workaround.

that's all.

Recommended Posts

Solves the problem that SwiftPM cannot cross the proxy and cannot add packages to the project
How to solve the problem that notification cannot be requested on iOS14
767 JSON :: ParserError occurs and the problem that the local server cannot be started
Add packages to your project with Swift PM
Add a shadow to the Swift Button (and also the circle)
Avoid the problem that session cannot be acquired when canary release when upgrading from Rails 4.2.x to 5.0.x
Lenovo ThinkPad T14 Gen1 How to solve the problem that the speaker becomes dummy and cannot be used when installing Ubuntu 20.04 on AMD