V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
qtoq126
V2EX  ›  iDev

为什么通过 xcode 的 SPM 加载不出 github 上的库?

  •  
  •   qtoq126 · 9 天前 · 1245 次点击
    通过 xcode 的 File -> Add Package Dependencies
    接着在右上角贴上 github 的地址,比如猫神的这个: https://github.com/onevcat/Kingfisher.git
    然后一直转菊花,要转很久,最后显示 Found 0 results
    这是什么原因?

    还有个就是,为什么我 remove 了包依赖,但是在左侧目录树上的最下方,还是会出现一些包依赖,根本删不干净

    xcode 是 16.2 ,系统是 Sequoia15.3

    我记得之前添加都是很顺利的,而且导入地址后,包很快就会出现,不知道为什么现在这么慢,而且加载不出包导致我无法进行后续的开发了
    15 条回复    2025-02-12 11:30:52 +08:00
    magic3584
        1
    magic3584  
       9 天前
    加代理啊
    qtoq126
        2
    qtoq126  
    OP
       9 天前
    @magic3584 加了代理,也没用
    Mephisto233
        3
    Mephisto233  
       9 天前
    终端代理没什么用,你要用代理的 tun 模式,让代理软件接管 Xcode 的流量
    SimleCp
        4
    SimleCp  
       9 天前   ❤️ 1
    clash 的增强模式有用.终端代理没用.
    SayHelloHi
        5
    SayHelloHi  
       9 天前
    1. 使用代理
    2. 打开代理的增强模式

    实在不行 只能全局了
    FaiChou
        6
    FaiChou  
       9 天前
    Xcode 对这一块搞的真是一坨💩,自己手动 git pull 下来拖到 Xcode 当个本地的 package 吧。
    KunQAQ
        7
    KunQAQ  
       9 天前
    xcode 等 github 账号用 SSH ,
    地址用 [email protected]/onevcat/Kingfisher.git
    okakuyang
        8
    okakuyang  
       9 天前
    代理开增强模式,或者在在终端里设置代理,再输入命令 open xcode ,或者使用 proxifier 。
    RayJiang9
        9
    RayJiang9  
       9 天前
    我的建议是别直接用 Xcode 自带的依赖管理,自己在项目里面建一个空的 SPM 项目。
    主工程 File -> Add Package Dependencies -> Add Local 把这个项目加进来,后续在空的 SPM 里面管理依赖。
    在空的 SPM 里把 Kingfisher 加进去
    终端代理,然后把 Xcode 关了,cd 到项目路径执行
    xcodebuild -resolvePackageDependencies -scmProvider system
    t4here
        10
    t4here  
       9 天前
    spm 怎么整个跟 packge.json libs.version.toml 这样的配置文件?
    MrKrabs
        11
    MrKrabs  
       9 天前
    ~/.gitconfig


    [http]
    proxy = socks5h://127.0.0.1:250
    qxmqh
        12
    qxmqh  
       9 天前
    手动拉下来吧,或者直接开启增强模式代理,另外如果是多人开发,我建议你们别搞代理了,就弄下来当本地包。不然以后恶心自己 也恶心别人。
    CodingIran
        13
    CodingIran  
       9 天前
    spm 是使用 git 拉取 remote 仓库,从没遇到过问题,你平时用 terminal git 拉取代码正常吗?本质上一样的
    CodingIran
        14
    CodingIran  
       9 天前
    目前我项目内所有的依赖都使用的 smp ,无论 Kingfisher 这样的公仓还是公司内网的私仓都一切正常
    不确定是你的网络问题还是遇到什么 bug ,可以尝试定位问题:
    1.在终端内 git clone Kingfisher 项目是否正常
    2.尝试清空 spm 缓存:
    rm -rf ~/Library/Caches/org.swift.swiftpm
    rm -rf ~/Library/org.swift.swiftpm
    qtoq126
        15
    qtoq126  
    OP
       8 天前
    @SimleCp 重新装了 ClashX ,开了增强模式,果然很快就出数据了。之前用的代理服务商自研的软件,貌似没有增强模式。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1047 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 19:09 · PVG 03:09 · LAX 11:09 · JFK 14:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.