CocoaPods/CocoaPods · error · Pod::Informative

Cannot analyze without fetching dependencies since the sandb

Error message

Cannot analyze without fetching dependencies since the sandbox is not up-to-date. Run `pod install` to ensure all dependencies have been fetched.
    The missing dependencies are:
    	#{dependencies_to_fetch(podfile_state).reject(&:local?).join("\n    \t")}

What it means

Installer::Analyzer#analyze raises this when it is not allowed to fetch (allow_fetches false) yet the Podfile's dependencies include non-local pods missing from the sandbox — dependencies_to_fetch(podfile_state).reject(&:local?) lists them in the message. The :outdated symbol is special-cased because `pod outdated` only resolves versions; true fetches up front; anything else must find every pod already in the sandbox.

Source

Thrown at lib/cocoapods/installer/analyzer.rb:120

      def analyze(allow_fetches = true)
        return @result if @result
        validate_podfile!
        validate_lockfile_version!
        if installation_options.integrate_targets?
          target_inspections = inspect_targets_to_integrate
        else
          verify_platforms_specified!
          target_inspections = {}
        end
        podfile_state = generate_podfile_state

        store_existing_checkout_options
        if allow_fetches == :outdated
          # special-cased -- we're only really resolving for outdated, rather than doing a full analysis
        elsif allow_fetches == true
          fetch_external_sources(podfile_state)
        elsif !dependencies_to_fetch(podfile_state).all?(&:local?)
          raise Informative, 'Cannot analyze without fetching dependencies since the sandbox is not up-to-date. Run `pod install` to ensure all dependencies have been fetched.' \
            "\n    The missing dependencies are:\n    \t#{dependencies_to_fetch(podfile_state).reject(&:local?).join("\n    \t")}"
        end

        locked_dependencies = generate_version_locking_dependencies(podfile_state)
        resolver_specs_by_target = resolve_dependencies(locked_dependencies)
        validate_platforms(resolver_specs_by_target)
        specifications = generate_specifications(resolver_specs_by_target)
        aggregate_targets, pod_targets = generate_targets(resolver_specs_by_target, target_inspections)
        sandbox_state = generate_sandbox_state(specifications)
        specs_by_target = resolver_specs_by_target.each_with_object({}) do |rspecs_by_target, hash|
          hash[rspecs_by_target[0]] = rspecs_by_target[1].map(&:spec)
        end
        specs_by_source = Hash[resolver_specs_by_target.values.flatten(1).group_by(&:source).map do |source, specs|
          [source, specs.map(&:spec).uniq]
        end]
        sources.each { |s| specs_by_source[s] ||= [] }
        @result = AnalysisResult.new(podfile_state, specs_by_target, specs_by_source, specifications, sandbox_state,
                                     aggregate_targets, pod_targets, @podfile_dependency_cache)

View on GitHub (pinned to b80e113e28)

Solutions

  1. Run `pod install` so all listed missing dependencies are fetched into the sandbox.
  2. If pods are missing due to a wiped/corrupt sandbox, `rm -rf Pods && pod install`.
  3. If you call the Analyzer programmatically, pass allow_fetches: true (or :outdated only for outdated checks) instead of false.
  4. Mark intentionally local pods with `:path =>` so they count as local and never require fetching.

Example fix

# before
analyzer = Pod::Installer::Analyzer.new(sandbox, podfile, lockfile)
analyzer.analyze(false)  # raises when sandbox is missing pods
# after
analyzer.analyze(true)   # allow fetching external sources
# or simply: system('pod install')
Defensive patterns

Strategy: validation

Validate before calling

# Ensure the sandbox holds every non-local dependency before analyzing
diff Podfile.lock Pods/Manifest.lock > /dev/null 2>&1 || pod install
[ -d Pods ] || pod install

Try / catch

# Programmatic: only analyze without fetches when the sandbox is provably complete
missing = dependencies.reject { |d| d.local? || File.directory?(File.join('Pods', d.name.split('/').first)) }
analyzer.analyze(missing.empty? ? false : true)

Prevention

When it happens

Trigger: Programmatic analysis with fetching disabled (Analyzer#analyze where allow_fetches is false, e.g. older-style `analyze(false)`) on a sandbox missing pods: fresh project, deleted Pods/, or pods newly added to the Podfile. CLI users hit equivalents of this when tools analyze before installing.

Common situations: Custom tooling/gems driving Analyzer directly with fetches off; `pod install` flows after someone removed Pods/; CI checkout where the sandbox cache wasn't populated; switching machines without running install.

Related errors


AI-assisted analysis of CocoaPods/CocoaPods@b80e113e28 (2026-08-21). Data as JSON: /api/errors/61bf2f9bc9e31e84. Report an issue: GitHub.