CocoaPods 找不到 pod“Flutter”的兼容版本:在 Podfile 中:Flutter(来自 `Flutter`)

Ale*_*ung 13 ios cocoapods flutter

升级到 flutter 3.1 后,我可以在 android 上构建并运行,但在 ios 上出现以下错误。我可以知道这个问题的原因是什么吗?

\n
Aungs-MBP:ios aungmyooo$ pod install\nAnalyzing dependencies\nfirebase_analytics: Using Firebase SDK version \'8.15.0\' defined in \'firebase_core\'\nfirebase_core: Using Firebase SDK version \'8.15.0\' defined in \'firebase_core\'\nWarning: firebase_app_id_file.json file does not exist. This may cause issues in upload-symbols. If this error is unexpected, try running flutterfire configure again.\nfirebase_crashlytics: Using Firebase SDK version \'8.15.0\' defined in \'firebase_core\'\nfirebase_messaging: Using Firebase SDK version \'8.15.0\' defined in \'firebase_core\'\n[!] CocoaPods could not find compatible versions for pod "Flutter":\n  In Podfile:\n    Flutter (from `Flutter`)\n\nSpecs satisfying the `Flutter (from `Flutter`)` dependency were found, but they required a higher minimum deployment target.\n
Run Code Online (Sandbox Code Playgroud)\n
\n

[\xe2\x9c\x93] Flutter(Channel master,3.1.0-0.0.pre.1279,在 macOS 12.4 21F79\ndarwin-x64 上,区域设置 en-GB)\n\xe2\x80\xa2 Flutter 版本 3.1.0 -0.0.pre.1279 位于 /Users/aungmyooo/Development/flutter\n\xe2\x80\xa2 上游存储库https://github.com/flutter/flutter.git \n\xe2\x80\xa2 框架修订版 ddeb0b99c5 ( 18 小时前),2022-06-16 13:53:23 -0700\n\xe2\x80\xa2 引擎修订版 f8c0dc87bc\n\xe2\x80\xa2 Dart 版本 2.18.0(内部版本 2.18.0-189.0.dev) )\n\xe2\x80\xa2 开发工具版本 2.14.0

\n

[\xe2\x9c\x93] Android 工具链 - 为 Android 设备开发(Android SDK\n版本 31.0.0)\n\xe2\x80\xa2 Android SDK,位于 /Users/aungmyooo/Library/Android/sdk\n\xe2\ x80\xa2 平台 android-32,构建工具 31.0.0\n\xe2\x80\xa2 Java 二进制文件位于:/Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java\n\xe2\ x80\xa2 Java 版本 OpenJDK 运行时环境(内部版本 11.0.11+0-b60-7590822)\n\xe2\x80\xa2 接受所有 Android 许可证。

\n

[\xe2\x9c\x93] Xcode - 为 iOS 和 macOS 开发 (Xcode 13.4.1)\n\xe2\x80\xa2 Xcode,位于 /Applications/Xcode.app/Contents/Developer\n\xe2\x80\xa2 CocoaPods版本1.11.3

\n

[\xe2\x9c\x93] Chrome - 为网络开发\n\xe2\x80\xa2 Chrome,位于 /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

\n

[\xe2\x9c\x93] Android Studio(版本 2021.1)\n\xe2\x80\xa2 Android Studio 位于 /Applications/Android Studio.app/Contents\n\xe2\x80\xa2 Flutter 插件可以从以下位置安装:\ n https://plugins.jetbrains.com/plugin/9212-flutter \n\xe2\x80\xa2 Dart 插件可以从以下位置安装:\n https://plugins.jetbrains.com/plugin/6351-dart \n \xe2\x80\xa2 Java 版本 OpenJDK 运行时环境(内部版本 11.0.11+0-b60-7590822)

\n

[\xe2\x9c\x93] VS Code(版本 1.68.1)\n\xe2\x80\xa2 VS Code 位于 /Applications/Visual Studio Code.app/Contents\n\xe2\x80\xa2 Flutter 扩展版本 3.42。 0

\n

[\xe2\x9c\x93] 连接的设备(3 个可用)\n\xe2\x80\xa2 SM N975F(移动设备) \xe2\x80\xa2 RF8M82Y3K9A \xe2\x80\xa2 android-arm64 \xe2\x80\xa2 Android 12 (API 31)\n\xe2\x80\xa2 macOS(桌面)\xe2\x80\xa2 macos \xe2\x80\xa2 darwin-x64 \xe2\x80\xa2 macOS 12.4 21F79 darwin-x64\n\xe2\ x80\xa2 Chrome(网络)\xe2\x80\xa2 chrome \xe2\x80\xa2 web-javascript \xe2\x80\xa2 Google Chrome 102.0.5005.115

\n

[\xe2\x9c\x93] HTTP 主机可用性\n\xe2\x80\xa2 所有必需的 HTTP 主机均可用

\n

\xe2\x80\xa2 未发现问题!

\n
\n

Kau*_*dru 55

在 ios 文件夹 -> PodFile 中。你会看到平台的版本是9并且有注释。请取消注释并将版本设置为11.0

# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
Run Code Online (Sandbox Code Playgroud)

编辑 - 2024

# Uncomment this line to define a global platform for your project
platform :ios, '13.0'
Run Code Online (Sandbox Code Playgroud)

  • 实际上,平台:ios,'10.0',我将其更新到11。然后它就可以工作了。那么flutter 3.0只支持ios 11? (4认同)
  • 是的,11 号有效 (2认同)
  • 这里不起作用。所以我更新了 flutter,当我运行它时,它自动更新为 12. 2024 答案。 (2认同)