卷曲:(22)请求的URL返回错误:403通过可可豆荚安装linphone时被禁止吗?

时间:2019-11-16 08:34:23

标签: ios swift cocoapods linphone

我正在通过可可豆荚安装linphone并出现错误

以下是pod文件的代码

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'SimLess' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!


  # Pods for SimLess
    pod 'liblinphone'
    pod 'Alamofire'
    pod 'SwiftyJSON'
    pod 'IQKeyboardManagerSwift'
    pod 'Kingfisher'
    pod 'MBProgressHUD'
    pod 'SCNetworkReachability'
    pod  'ReachabilitySwift'
    pod 'SideMenu'
  target 'SimLessTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'ProjectNameUITests' do
    inherit! :search_paths
    # Pods for testing
  end

结束

我遇到以下错误:

[!]安装liblinphone时出错 [!] / usr / bin / curl -f -L -o /var/folders/ry/smn70dn550xflcjls8_hh2t40000gn/T/d20191116-26192-nqvjxb/file.zip https://lingusocial-media-eu.ams3.digitaloceanspaces.com/shared/liblinphone-iphone-sdk-4.0.2.zip --create-dirs --netrc-optional -重试2

%总接收百分比%Xferd平均速度时间时间时间当前                                  Dload上传总花费左速度   0 0 0 0 0 0 0 0-:-:-0:00:01-:-:-0 curl:(22)请求的URL返回错误:403 Forbidden

该如何解决?

注意:如果我要删除libliphone,则其他Pod已成功安装。

2 个答案:

答案 0 :(得分:0)

您能使用

吗?
   pod 'Liblinphone'

代替

    pod 'liblinphone'

所有豆荚均以大写字母开头 如果所有方法都不能解决您的问题,那么请

 sudo gem install cocoapods

这将确保您的cocoapods中可以使用“ Liblinphone” 或

 pod try liblinphone

答案 1 :(得分:0)

使用以下代码已解决该问题:

# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
source "https://gitlab.linphone.org/BC/public/podspec.git"
source "https://github.com/CocoaPods/Specs.git"

def basic_pods
  if ENV['PODFILE_PATH'].nil?
    pod 'linphone-sdk/basic-frameworks', '> 4.3.0-alpha'
    else
    pod 'linphone-sdk/basic-frameworks', :path => ENV['PODFILE_PATH']  # loacl sdk
  end

  if not ENV['USE_CRASHLYTHICS'].nil?
    # activate crashlythics
    pod 'Firebase/Core'
    pod 'Fabric', '~> 1.9.0'
    pod 'Crashlytics', '~> 3.12.0'
    pod 'Firebase/Performance'

  end
end

target ‘ProjectNameTests' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!

  # Pods for liblinphoneTester
  basic_pods

  target 'ProjectNameUITests' do
    inherit! :search_paths
    # Pods for testing
  end

end

target 'ProjectName' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!

  # Pods for linphone
  basic_pods
  pod 'SVProgressHUD'
  pod 'Alamofire'


end


=begin
target 'latestCallsWidget' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!

  # Pods for latestCallsWidget

end

target 'latestChatroomsWidget' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!

  # Pods for latestChatroomsWidget
end


target 'richNotifications' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!

  # Pods for richNotifications

end
=end

post_install do |installer|
  # Get the version of linphone-sdk
  installer.pod_targets.each do |target|
    if target.pod_name == 'linphone-sdk'
      target.specs.each do |spec|
        $linphone_sdk_version = spec.version
      end
    end
  end

  app_project = Xcodeproj::Project.open(Dir.glob("*.xcodeproj")[0])
  app_project.native_targets.each do |target|
    if target.name == 'ProjectName'
      target.build_configurations.each do |config|
        if ENV['USE_CRASHLYTHICS'].nil?
          if config.name == "Debug" then
            config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) DEBUG=1'
          else
            config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited)'
          end
        else
          # activate crashlythics
          if config.name == "Debug" then
            config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) DEBUG=1 USE_CRASHLYTHICSS=1'
            else
            config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) USE_CRASHLYTHICSS=1'
          end
        end

        config.build_settings['OTHER_CFLAGS'] = '-DBCTBX_LOG_DOMAIN=\"ios\"',
                                                '-DCHECK_VERSION_UPDATE=FALSE',
                                                '-DENABLE_QRCODE=TRUE',
                                                '-DENABLE_SMS_INVITE=TRUE',
                                                '$(inherited)',
                                                "-DLINPHONE_SDK_VERSION=\\\"#{$linphone_sdk_version}\\\""

        app_project.save
      end
    end
  end
end