运行 pod install 时出错 - 在目标 `Runner` 上自动分配版本为 `8.0` 的平台`iOS`

Posted

技术标签:

【中文标题】运行 pod install 时出错 - 在目标 `Runner` 上自动分配版本为 `8.0` 的平台`iOS`【英文标题】:Error running pod install - Automatically assigning platform `iOS` with version `8.0` on target `Runner` 【发布时间】:2020-09-18 00:18:10 【问题描述】:

你好,我无法用 Cocoapods 解决这个问题,任何人都可以帮助我,这是我第一次使用这个 import-import 'package:flutter_vlc_player/flutter_vlc_player.Dart'; 而不是什么可能是错的。

(我在mac上使用android studio)

错误:

在 iPhone 11 上以调试模式启动 lib/main.dart... 运行 pod install... 1,3s CocoaPods 的输出: ↳ 准备中

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `flutter_vlc_player` from `.symlinks/plugins/flutter_vlc_player/ios`

Resolving dependencies of `Podfile`
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
[!] CocoaPods could not find compatible versions for pod "flutter_vlc_player":
  In Podfile:
    flutter_vlc_player (from `.symlinks/plugins/flutter_vlc_player/ios`)

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

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `tap'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:684:in `attempt_to_activate'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:254:in `process_topmost_state'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/resolver.rb:94:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/analyzer.rb:1065:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/analyzer.rb:1063:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:410:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:235:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:234:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:156:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

CocoaPods 的错误输出: ↳

[!] Automatically assigning platform `iOS` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

运行 pod install 时出错 在 iPhone 11 上启动应用程序时出错。

【问题讨论】:

【参考方案1】:

打开 [YourProject]/ios/Podfile 并从 platform :ios, '9.0' 中删除 # 符号,然后尝试 flutter run。 如果它不起作用,请将版本号例如增加到 10.0

【讨论】:

【参考方案2】:

将 Podfile 设置为包所需的版本会起作用。

例如,如果您想使用 webview_cookie_manager 2.0.0,您应该将 iOS 的最低版本设置为 11.0,如其规范页面上给出的那样。

https://pub.dev/packages/webview_cookie_manager

所以在 Podfile 上,设置平台 ios 值如下所示。

 platform :ios, '11.0'

【讨论】:

以上是关于运行 pod install 时出错 - 在目标 `Runner` 上自动分配版本为 `8.0` 的平台`iOS`的主要内容,如果未能解决你的问题,请参考以下文章

运行 pod install 时出错:如何解决这个问题?

运行 pod install 时出错:`UMFileSystemInterface` 依赖于`EXAV`

安装Firebase后运行pod install --repo-update时出错

在终端的 Podfile 上使用 Pod Install 命令时出错

运行 pod install 后找不到目标文件

Pod install 显示错误,例如需要更高的最小部署目标