【问题标题】:No podspec found for `geolocator_web` in `.symlinks/plugins/geolocator_web/ios` flutter ios在`.symlinks/plugins/geolocator_web/ios`中找不到`geolocator_web`的podspec
【发布时间】:2021-05-19 23:56:34
【问题描述】:

我正在安装 pod。 显示此类型错误。

[!] 在 .symlinks/plugins/geolocator_web/ios 中找不到 geolocator_web 的 podspec

我不使用 geolocator_web 或 geolocator。

flutter ios pod 安装错误显示。

如何解决?

【问题讨论】:

    标签: android ios flutter dart


    【解决方案1】:

    对我来说,我通过以下步骤解决了这个问题:

    1。我将我的 podfile 还原为:

    # 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。然后在终端上执行此操作:

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

    3。那么:

    flutter pub get
    pod install
    

    通常是 podfile 导致这些错误

    【讨论】:

      【解决方案2】:

      如果你们中的任何人都在为这个错误而苦苦挣扎,并且以下方法都不起作用:

      • flutter clean & flutter pub get
      • (arch -x86_64) pod repo update & (arch -x86_64) pod install
      • XCode 中的Clean Build Folder
      • 删除项目文件夹并再次克隆 git repo
      • 重启IDE
      • 删除ios文件夹和flutter create ios
      • ...

      试试这个:

      1. 删除 Flutter SDK 文件夹中的 /.pub-cache
      2. flutter clean & flutter pub get
      3. pod install

      我总是收到“没有为 xxx 找到 podspec ~~”错误,其中 xxx 可以是任何插件,并且发现某些插件永远不会将其 podspec 文件复制到 ios/.symlinks/pluginx/xxx/ios 文件夹中在pod install之后。

      删除 /.pub-cache 后,我可以确认所有 podspec 文件都已到位。

      flutter pub cache repair 命令似乎做同样的事情,但我没有尝试这个。

      【讨论】:

        猜你喜欢
        • 2019-05-24
        • 1970-01-01
        • 2020-09-03
        • 2019-12-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-10-11
        相关资源
        最近更新 更多