android - 无法在 iOS 模拟器或物理设备上构建 Flutter 应用程序 - 虽然在 Android 上运行良好
问题描述
一段时间后,我回到了 Android Studio & Flutter,我尝试构建我的应用程序,但出现以下错误:
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
运行 pod install... CocoaPods 的输出:↳ Preparing
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 `url_launcher` from `.symlinks/plugins/url_launcher/ios`
-> Fetching podspec for `webview_flutter` from `.symlinks/plugins/webview_flutter/ios`
Resolving dependencies of `Podfile`
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
Comparing resolved specification to the sandbox manifest
A Flutter
A url_launcher
A webview_flutter
Downloading dependencies
-> Installing Flutter (1.0.0)
-> Installing url_launcher (0.0.1)
-> Installing webview_flutter (0.0.1)
- Running pre install hooks
[!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (/Users/ashleywhitehair/AndroidStudioProjects/cvonline-master/ios/Flutter/Flutter.framework)
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/target_validator.rb:84:in `block (2 levels) in verify_no_static_framework_transitive_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/target_validator.rb:74:in `each_key'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/target_validator.rb:74:in `block in verify_no_static_framework_transitive_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/target_validator.rb:73:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/target_validator.rb:73:in `verify_no_static_framework_transitive_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/target_validator.rb:38:in `validate!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:595:in `validate_targets'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:162:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/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.10.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
CocoaPods 的错误输出:↳</p>
[!] 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 Pro Max 上启动应用程序时出错。
解决方案
用下面的文本替换整个 pod 文件。
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'testing_gowtham' do
use_frameworks!
pod 'Firebase/Core'
pod 'Firebase/Firestore'
end
如果解决方案 1 不起作用,那么您也可以尝试解决方案 2
platform :ios, '9.0'
正在工作...我只是删除了#这个
推荐阅读
- reactjs - 重复的 JSON 数据 - React Native
- javascript - 我想根据它们的 id 对两个数组的对象进行联合
- javascript - 带有 webpack 的车把 - 变量没有传递给自定义帮助程序
- mips - 我的汇编代码有这个错误:“无效的程序计数器值:0x00000000 Go:执行因错误而终止”
- bash - Athena 查询通过 shell 脚本提交
- python - 如何使用 Python 使用 OAuth 和 Outlook 发送电子邮件?
- css - 在 SASS 中使用类数组
- java - 如何从 android 的 FireStore 中仅检索字段(字段名称)作为列表数组?
- reactjs - Create-react-app 无法创建项目(语法不正确)
- javascript - 谷歌应用脚本公式中的未知错误