CocoaPods 找不到 pod "MatrixSDK" 的兼容版本

CocoaPods could not find compatible versions for pod "MatrixSDK"

我正在尝试从 xcode 构建应用程序。
我从 git repo.
克隆了这个项目 我打开了 .xcodeproj 文件并从 Product > Build 我尝试构建但构建失败。
从终端我执行了以下命令并收到兼容版本错误

我搜索了解决方案并尝试了以下几种方法:

sudo gem 安装 cocoapods
sudo gem intall cocoapods --pre
吊舱设置
pod 分解
pod 安装
吊舱更新
pod install --repo-update

终端输出如下:

Analyzing dependencies
Pre-downloading: `BarcodeScanner` from `https://github.com/htothee/BarcodeScanner.git`
Pre-downloading: `MatrixKit` from `https://github.com/N-Pex/matrix-ios-kit.git`, branch `fix_apns_push`
Pre-downloading: `MatrixSDK` from `https://github.com/matrix-org/matrix-ios-sdk.git`, branch `develop`
Pre-downloading: `QRCode` from `https://github.com/brackendev/QRCode.git`
[!] CocoaPods could not find compatible versions for pod "MatrixSDK":
  In Podfile:
    MatrixKit (from `https://github.com/N-Pex/matrix-ios-kit.git`, branch `fix_apns_push`) was resolved to 0.10.1, which depends on
      MatrixSDK (= 0.13.0)

    MatrixSDK (from `https://github.com/matrix-org/matrix-ios-sdk.git`, branch `develop`)

下面是 Podfile

platform :ios, '9.3'
use_frameworks!

def shared_pods
    pod 'ProjectCore', :path => '../'
    pod 'MatrixKit', :git => 'https://github.com/N-Pex/matrix-ios-kit.git', :branch => 'fix_apns_push'
    pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop'
end

target 'Project_Example' do
  shared_pods

  pod 'BarcodeScanner', :git => 'https://github.com/htothee/BarcodeScanner.git'
  pod 'QRCode', :git => 'https://github.com/brackendev/QRCode.git'

  pod 'Project', :path => '../'

  target 'Project_Tests' do
    inherit! :search_paths
  end
end

target 'ShareExtension' do
  shared_pods

  pod 'ProjectExtension', :path => '../'
end

预期:
需要创建 .ipa 文件

请告诉我如何解决。

而不是projectname.xcodeproj,请尝试打开projectname.xcworkspace。

你的问题在错误中有解释:

[!] CocoaPods could not find compatible versions for pod "MatrixSDK": In Podfile: MatrixKit (from https://github.com/N-Pex/matrix-ios-kit.git, branch fix_apns_push) was resolved to 0.10.1, which depends on MatrixSDK (= 0.13.0)

MatrixKit 的分支 fix_apns_push 需要 MatrixSDK 的固定版本,如您在其 Podspec file

中所见
pod 'MatrixSDK', '0.13.0'

因此,为了让您的项目正常运行,您需要这个版本。

试试这个:

def shared_pods
    pod 'ProjectCore', :path => '../'
    pod 'MatrixKit', :git => 'https://github.com/N-Pex/matrix-ios-kit.git', :branch => 'fix_apns_push'
    pod 'MatrixSDK', '0.13.0'
end

我也遇到同样的问题 CocoaPods 找不到 pod“Branch”的兼容版本

删除 Podfile.lock 和 Pods 然后执行 pod install

rm -rf ./Pods Podfile.lock

pod install --repo-update

试试这个,这对我有用。谢谢