解决Flutter出现CocoaPods报错情况(Mac和IOS)

 更新时间:2023年08月09日 10:00:18   作者:ClearBoth  
这篇文章主要为大家介绍了解决Flutter出现CocoaPods报错情况(Mac和IOS)的方法详解,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪

错误情况

Launching lib/main.dart on iPad Pro (12.9-inch) (5th generation) in debug mode...
main.dart:1
CocoaPods' output:
↳
      Preparing
    Analyzing dependencies
    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
    Finding Podfile changes
      A image_editor_dove
     - Flutter
      - file_picker
      - flutter_image_compress
      - flutter_secure_storage
      - image_gallery_saver
      - image_picker_ios
      - path_provider_foundation
      - sqflite
    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `file_picker` from `.symlinks/plugins/file_picker/ios`
    -> Fetching podspec for `flutter_image_compress` from `.symlinks/plugins/flutter_image_compress/ios`
    -> Fetching podspec for `flutter_secure_storage` from `.symlinks/plugins/flutter_secure_storage/ios`
    -> Fetching podspec for `image_editor_dove` from `.symlinks/plugins/image_editor_dove/ios`
    [!] No podspec found for `image_editor_dove` in `.symlinks/plugins/image_editor_dove/ios`
    /Users/shixin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/lib/cocoapods/external_sources/path_source.rb:14:in `block in fetch'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/lib/cocoapods/user_interface.rb:64:in `section'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/lib/cocoapods/external_sources/path_source.rb:11:in `fetch'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/lib/cocoapods/installer/analyzer.rb:997:in `fetch_external_source'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/lib/cocoapods/installer/analyzer.rb:976:in `block (2 levels) in fetch_external_sources'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/lib/cocoapods/installer/analyzer.rb:975:in `each'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/lib/cocoapods/installer/analyzer.rb:975:in `block in fetch_external_sources'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/lib/cocoapods/user_interface.rb:64:in `section'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/lib/cocoapods/installer/analyzer.rb:974:in `fetch_external_sources'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/lib/cocoapods/installer/analyzer.rb:118:in `analyze'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:422:in `analyze'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:244:in `block in resolve_dependencies'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/lib/cocoapods/user_interface.rb:64:in `section'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:243:in `resolve_dependencies'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:162:in `install!'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/lib/cocoapods/command/install.rb:52:in `run'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/lib/cocoapods/command.rb:52:in `run'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:23:in `load'
    /usr/local/bin/pod:23:in `<main>'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/bin/ruby_executable_hooks:22:in `eval'
    /Users/shixin/.rvm/rubies/ruby-2.7.2/bin/ruby_executable_hooks:22:in `<main>'

分析解决

这种情况,首先在终端cd进入到Flutter项目相应的ios或者mac目录下

删除对应的Podfile.lock文件

运行

pod install --verbose --no-repo-update

在运行中,又可能会报错

情况1:

Specs satisfying the flutter_sound (from.symlinks/plugins/flutter_sound/ios) dependency were found, but they required a higher minimum deployment target.

解决办法

这种的,是包的版本问题

1.去目录的Pods - Local Podspecs - ”包名“ 打开以后找到

```
"platforms": {
    "osx": "10.14"
  },
```

2.打开目录的PodFile,在第一行,

`platform :osx, '10.11'`

3.报错是因为包的平台版本要求跟我们定义的平台版本要求不一样,版本太低,所以改成跟包是一样的版本就可以了,保存以后继续重复情况1的pod install --verbose --no-repo-update命令

4.可能还会报错,这个时候全局搜索一下相应的配置,可能在Runner.xcodeproj的project.pbxproj中还有没有改正过来的平台版本号,改正一下。

5.现在再去更新命令,就会重新生成Podfile.lock文件了,并且可以重新启动

情况2:

[!] No podspec found for `device_info_plus` in `../hmc_flutter_module/.ios/.symlinks/plugins/device_info_plus/ios`

解决办法:

如图:

以上就是解决Flutter出现CocoaPods报错情况(Mac和IOS)的详细内容,更多关于Flutter CocoaPods报错解决的资料请关注脚本之家其它相关文章!

相关文章

  • 详解iOS多线程GCD问题

    详解iOS多线程GCD问题

    本篇文章主要介绍了iOS多线程GCD问题,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2016-11-11
  • iOS实现文字水平无间断滚动效果

    iOS实现文字水平无间断滚动效果

    这篇文章主要为大家详细介绍了iOS实现文字水平无间断滚动效果,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2019-08-08
  • 关于iOS中属性变量setter与getter方法的理解

    关于iOS中属性变量setter与getter方法的理解

    这篇文章主要给大家介绍了关于iOS中属性变量setter与getter方法的相关资料,文章介绍的非常详细,对大家具有一定的参考学习价值,需要的朋友们下面来一起看看吧。
    2017-06-06
  • IOS代码笔记之左右滑动效果

    IOS代码笔记之左右滑动效果

    这篇文章主要为大家详细介绍了IOS代码笔记之左右滑动效果的相关资料,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2016-07-07
  • iOS 中事件的响应链和传递链

    iOS 中事件的响应链和传递链

    iOS事件链有两条:事件的响应链;Hit-Testing事件的传递链。这篇文章主要介绍了iOS 中事件的响应链和传递链,非常不错,具有一定的参考借鉴价值,需要的朋友可以参考下
    2019-12-12
  • 12个iOS技术面试题及答案总结

    12个iOS技术面试题及答案总结

    这篇文章给大家总结了在iOS面试的时候可能会遇到的12个技术面试题,以及这些面试题但答案,这些答案只是给大家一些参考,大家可以再结合自己理解进行回答,有需要的朋友们下面来一起看看吧。
    2016-09-09
  • iOS滑动解锁、滑动获取验证码效果的实现代码

    iOS滑动解锁、滑动获取验证码效果的实现代码

    这篇文章主要介绍了iOS滑动解锁、滑动获取验证码效果的实现代码,小编认为还不错,非常实用,所有分享给大家,感兴趣的朋友可以参考下
    2016-05-05
  • iOS11&iPhoneX适配&Xcode9打包注意事项

    iOS11&iPhoneX适配&Xcode9打包注意事项

    这篇文章主要介绍了iOS11&iPhoneX适配&Xcode9打包注意事项,需要的朋友可以参考下
    2017-10-10
  • IOS 通讯录信息读取兼容的实现方法

    IOS 通讯录信息读取兼容的实现方法

    这篇文章主要介绍了IOS 通讯录信息读取兼容的实现方法的相关资料,这里提供实现方法帮助大家实现这样的功能,需要的朋友可以参考下
    2017-08-08
  • 查看iOS Crash logs的方法

    查看iOS Crash logs的方法

    发布了一个应用,用户使用 的时候crash了,现在想调查为何crash,所以想在这里探讨一下如何查看iphone 手机的crash logs
    2015-06-06

最新评论