【发布时间】:2021-05-19 23:56:34
【问题描述】:
我正在安装 pod。 显示此类型错误。
[!] 在 .symlinks/plugins/geolocator_web/ios 中找不到 geolocator_web 的 podspec
我不使用 geolocator_web 或 geolocator。
flutter ios pod 安装错误显示。
如何解决?
【问题讨论】:
我正在安装 pod。 显示此类型错误。
[!] 在 .symlinks/plugins/geolocator_web/ios 中找不到 geolocator_web 的 podspec
我不使用 geolocator_web 或 geolocator。
flutter ios pod 安装错误显示。
如何解决?
【问题讨论】:
对我来说,我通过以下步骤解决了这个问题:
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end
flutter clean
rm -Rf ios/Pods
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec
flutter pub get
pod install
通常是 podfile 导致这些错误
【讨论】:
如果你们中的任何人都在为这个错误而苦苦挣扎,并且以下方法都不起作用:
flutter clean & flutter pub get
(arch -x86_64) pod repo update & (arch -x86_64) pod install
Clean Build Folder
flutter create ios
试试这个:
flutter clean & flutter pub get
pod install我总是收到“没有为 xxx 找到 podspec ~~”错误,其中 xxx 可以是任何插件,并且发现某些插件永远不会将其 podspec 文件复制到 ios/.symlinks/pluginx/xxx/ios 文件夹中在pod install之后。
删除 /.pub-cache 后,我可以确认所有 podspec 文件都已到位。
flutter pub cache repair 命令似乎做同样的事情,但我没有尝试这个。
【讨论】: