简体   繁体   中英

No podspec found for `geolocator_web` in `.symlinks/plugins/geolocator_web/ios` flutter ios

I am pod installing. This type error showing.

[!] No podspec found for geolocator_web in .symlinks/plugins/geolocator_web/ios

I am not uses of geolocator_web or geolocator.

flutter ios pod installing error showing.

How to fix it?

For me I solved this by doing these steps:

1. I reverted my podfile to:

# 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

2. and then do this on the terminal:

flutter clean
rm -Rf ios/Pods
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec

3. then:

flutter pub get
pod install

It's usually the podfile that causes these kinds of error

If any of you are struggling with this error and none of the following methods works:

  • flutter clean & flutter pub get
  • (arch -x86_64) pod repo update & (arch -x86_64) pod install
  • Clean Build Folder in XCode
  • Delete project folder and clone git repo again
  • Restart IDE
  • Delete ios folder & flutter create ios
  • ...

try this:

  1. delete /.pub-cache in Flutter SDK folder
  2. flutter clean & flutter pub get
  3. pod install

I was always getting this "no podspec found for xxx~~" error where xxx can be any plugin, and figured out that some plugins never get their podspec file copied into ios/.symlinks/pluginx/xxx/ios folder right after pod install .

After deleting /.pub-cache, I could confirm that all podspec files were in place.

flutter pub cache repair command seems like it does the same thing, but I didn't try this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM