[英]No podspec found for `geolocator_web` in `.symlinks/plugins/geolocator_web/ios` flutter ios
我正在安裝吊艙。 這種類型的錯誤顯示。
[!] 在.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 可以是任何插件,並且發現某些插件在pod install
之后永遠不會將它們的 podspec 文件復制到 ios/.symlinks/pluginx/xxx/ios 文件夾中.
刪除 /.pub-cache 后,我可以確認所有 podspec 文件都已到位。
flutter pub cache repair
命令似乎做同樣的事情,但我沒有嘗試這個。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.