ocoaPods could not find compatible versions for pod

image.png

https://github.com/bladeofgod/Bedrock/issues/7

https://gems.ruby-china.com/

请尽可能用比较新的 RubyGems 版本,建议 2.6.x 以上。

$ gem update --system # 这里请翻墙一下
$ gem -v
2.6.3
$ gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
$ gem sources -l
https://gems.ruby-china.com

确保只有 gems.ruby-china.com

ruby -v

为更新到ruby的最新版本,可通过以下命令解决:

brew update 

执行完命令后,ruby -v后其实还是原来的版本👌,这是因为环境变量没有配置。因此,还有一个步骤就是配置环境变量。

执行以下两步就OK了

echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile

source ~/.bash_profile

执行后,查看版本后,会判断已更新到最新版本。

我们发现已经是最新版本可继续进行下一步。

image.png
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
image.png

再次 brew update

 [!] CocoaPods could not find compatible versions for pod "MultiplatformBleAdapter":
      In snapshot (Podfile.lock):
        MultiplatformBleAdapter (= 0.1.6, ~> 0.1.6)

      In Podfile:
        flutter_ble_lib (from `.symlinks/plugins/flutter_ble_lib/ios`) was resolved to 2.3.2, which depends on
          MultiplatformBleAdapter (~> 0.1.8)

    Specs satisfying the `MultiplatformBleAdapter (= 0.1.6, ~> 0.1.6), MultiplatformBleAdapter (~> 0.1.8)` dependency were found, but they required a higher minimum deployment target.

明显是版本问题,Podfile.lock是我们本地的版本是0.1.6,而Podfile却要求 0.1.8。版本冲突是否可以强制指定呢?
我们知道Podfile.lock是用来强制版本一致的,这里可以删掉Podfile.lock试一试

然后执行pod repo update进行更新


image.png

libwebp pod install报错

image

解决方法:

1、前往文件夹:/用户/XXX/.cocoapods/repos/master/Specs/1/9/2/libwebp

2、打开相对应的版本

image.png

本人的版本号是1.2.0,注意我的pod repo显示的是两个分支,我使用的是trunk分支,所以修改的文件也要对应上


image.png

3、打开相对应的文件并将

"source": {
    "git": "https://github.com/webmproject/libwebp.git",
    "tag": "v1.2.0"
  }

将其中的“git”对应的url替换为https://github.com/webmproject/libwebp.git,并保存执行pod install

image.png

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容