ios 如何指定某个pod的具体来源?

gupuwyp2  于 2023-05-19  发布在  iOS
关注(0)|答案(5)|浏览(147)

虽然我相信这是无害的,但警告让我很恼火。所以我使用的是一个非常特定版本的TwilioChatClient,配合TwilioClient。这两个特定的版本就是Twilio在其示例项目中使用的版本。
无论如何,安装/更新Pod时的警告:
[!]找到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
[!]找到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
[!]找到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
[!]找到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
[!]找到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
[!]找到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
我的podfile:

project 'Proj/Proj.xcodeproj'

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

platform :ios, '10.0'
use_frameworks!

  target 'Proj' 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 'ProjUITests' do

  end

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

g0czyy6m

g0czyy6m1#

事实上,您的问题来自于您使用以下行将twilio repo添加到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时,可可pods可以在master的cocoapods repo和twilio的repo中找到这个库的一个版本。发出警告。
要删除此警告,请从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.
ha5z0ras

ha5z0ras2#

我只是想给予你一些关于这里的警告的背景知识。我们在beta测试(https://github.com/twilio/cocoapod-specs)期间使用了一个单独的cocoapods存储库,但在1.x发布后不久就开始发布到全球cocoapods存储库。
我们并没有停止发布我们现有的cocoapod-specs版本库,因为如果没有声明全局cocoapods版本库,这对使用beta源代码的现有客户来说将是一个突破性的变化。这就是Cocoapods所警告的,具有相同版本的相同pod在两个地方定义。podspecs是相同的,因此在使用出现此警告的任何SDK版本时都不会导致问题。
从2.x开始,我们一直只发布chat到全局存储库,这就是为什么警告在1.x系列发布时停止的原因。

mjqavswn

mjqavswn3#

首先,你还需要SDK。我现在在我的项目中安装了pod。它工作正常。查看此链接
http://cocoapods.org/?q=Twilio

Pod编码

project 'Proj/Proj.xcodeproj'

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

platform :ios, '10.0'
use_frameworks!

  target 'Proj' do

    pod 'TwilioSDK', '1.2.9'
    pod 'TwilioChatClient'

    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 'ProjUITests' do

  end
r6hnlfcb

r6hnlfcb4#

source 'https://github.com/CocoaPods/Specs.git'

   use_frameworks!

   platform :ios, '10.0' # (or whatever version you want)

   target 'Project Name' do

   pod 'TwilioSDK', '1.2.9'
   pod 'TwilioChatClient'

 post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '3.0'
            config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
            config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
            config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
        end
    end
end
42fyovps

42fyovps5#

只是某一个豆荚?:source属性也许这正是你正在寻找的。

target 'Runner' do

  pod 'Masonry', :source => 'https://cdn.cocoapods.org/'  ## is the `:source` what u want ???
  pod 'openssl', :path => 'pods/openssl'
  pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git',:tag => '5.7.0'

end

相关问题