OStack程序员社区-中国程序员成长平台

标题: ios - 如何为某个 pod 指定特定来源? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 15:53
标题: ios - 如何为某个 pod 指定特定来源?

虽然我相信这是无害的,但警告让我很恼火。因此,我将 TwilioChatClientTwilioClient 一起使用了一个非常具体的版本。这两个特定版本是 Twilio 在他们的示例项目中使用的版本。

无论如何,安装/更新 pod 时的警告:

[!] Found multiple specifications for TwilioChatClient (1.0.9): - /Users/XXX/.cocoapods/repos/master/Specs/7/d/e/TwilioChatClient/1.0.9/TwilioChatClient.podspec.json - /Users/XXX/.cocoapods/repos/twilio/TwilioChatClient/1.0.9/TwilioChatClient.podspec

[!] Found multiple specifications for TwilioChatClient (1.0.8): - /Users/XXX/.cocoapods/repos/master/Specs/7/d/e/TwilioChatClient/1.0.8/TwilioChatClient.podspec.json - /Users/XXX/.cocoapods/repos/twilio/TwilioChatClient/1.0.8/TwilioChatClient.podspec

[!] Found multiple specifications for TwilioChatClient (1.0.7): - /Users/XXX/.cocoapods/repos/master/Specs/7/d/e/TwilioChatClient/1.0.7/TwilioChatClient.podspec.json - /Users/XXX/.cocoapods/repos/twilio/TwilioChatClient/1.0.7/TwilioChatClient.podspec

[!] Found multiple specifications for TwilioChatClient (1.0.6): - /Users/XXX/.cocoapods/repos/master/Specs/7/d/e/TwilioChatClient/1.0.6/TwilioChatClient.podspec.json - /Users/XXX/.cocoapods/repos/twilio/TwilioChatClient/1.0.6/TwilioChatClient.podspec

[!] Found multiple specifications for TwilioChatClient (1.0.5): - /Users/XXX/.cocoapods/repos/master/Specs/7/d/e/TwilioChatClient/1.0.5/TwilioChatClient.podspec.json - /Users/XXX/.cocoapods/repos/twilio/TwilioChatClient/1.0.5/TwilioChatClient.podspec

[!] Found multiple specifications for TwilioChatClient (1.0.4): - /Users/XXX/.cocoapods/repos/master/Specs/7/d/e/TwilioChatClient/1.0.4/TwilioChatClient.podspec.json - /Users/XXX/.cocoapods/repos/twilio/TwilioChatClient/1.0.4/TwilioChatClient.podspec

我的播客文件:

project 'roj/Proj.xcodeproj'

source 'https://github.com/CocoaPods/Specs'
source 'https://github.com/twilio/cocoapod-specs'

platform :ios, '10.0'
use_frameworks!

  target 'roj' do

    pod 'TwilioClient', '~>1.2'     # Twilio Call Framework
    pod 'TwilioChatClient', '1.0.4' # Twilio Chat Framework


    target 'MobileMedTests' do
        inherit! :search_paths
    end

    post_install do |installer|
        installer.pods_project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '4.0'
            end
        end
    end

  end

  target 'rojUITests' do

  end

我认为指定两种来源(两者都是必要的)会导致这些警告。有没有办法将特定来源放在 pod 旁边?



Best Answer-推荐答案


实际上,您的问题来自您已使用以下行将 twilio 存储库添加到您的 pod 源:

source 'https://github.com/twilio/cocoapod-specs'

所以当你输入 pod repo 时,你会得到类似的东西:

master
- Type: git (master)
- URL:  https://github.com/CocoaPods/Specs.git
- Path: /Users/cyrille/.cocoapods/repos/master

twilio
- Type: git (master)
- URL:  https://github.com/twilio/cocoapod-specs
- Path: /Users/cyrille/.cocoapods/repos/twilio

当你执行 pod install 时,cocoa pods 可以在 master 的 cocoapods repo 和 twilio 的 repo 中找到这个 lib 的一个版本......这会发出警告。

要删除此警告,请从您的 Podfile 中删除此行:

source 'https://github.com/twilio/cocoapod-specs'

在终端中执行以下命令:

pod repo remove twilio

然后:

pod update

您应该不会再收到以下警告:

Analyzing dependencies
Removing TwilioClient
Downloading dependencies
Installing TwilioChatClient 2.2.0 (was 1.0.4)
Installing TwilioSDK (1.2.9)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 2 dependencies from the Podfile and 2 total pods installed.

关于ios - 如何为某个 pod 指定特定来源?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48109435/






欢迎光临 OStack程序员社区-中国程序员成长平台 (http://ostack.cn/) Powered by Discuz! X3.4