{"record":{"id":"61bf2f9bc9e31e84","repo":"CocoaPods/CocoaPods","slug":"cannot-analyze-without-fetching-dependencies-since","errorCode":null,"errorMessage":"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\")}","messagePattern":"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#(.+?)","errorType":"exception","errorClass":"Pod::Informative","httpStatus":null,"severity":"error","filePath":"lib/cocoapods/installer/analyzer.rb","lineNumber":120,"sourceCode":"      def analyze(allow_fetches = true)\n        return @result if @result\n        validate_podfile!\n        validate_lockfile_version!\n        if installation_options.integrate_targets?\n          target_inspections = inspect_targets_to_integrate\n        else\n          verify_platforms_specified!\n          target_inspections = {}\n        end\n        podfile_state = generate_podfile_state\n\n        store_existing_checkout_options\n        if allow_fetches == :outdated\n          # special-cased -- we're only really resolving for outdated, rather than doing a full analysis\n        elsif allow_fetches == true\n          fetch_external_sources(podfile_state)\n        elsif !dependencies_to_fetch(podfile_state).all?(&:local?)\n          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            \"\\n    The missing dependencies are:\\n    \\t#{dependencies_to_fetch(podfile_state).reject(&:local?).join(\"\\n    \\t\")}\"\n        end\n\n        locked_dependencies = generate_version_locking_dependencies(podfile_state)\n        resolver_specs_by_target = resolve_dependencies(locked_dependencies)\n        validate_platforms(resolver_specs_by_target)\n        specifications = generate_specifications(resolver_specs_by_target)\n        aggregate_targets, pod_targets = generate_targets(resolver_specs_by_target, target_inspections)\n        sandbox_state = generate_sandbox_state(specifications)\n        specs_by_target = resolver_specs_by_target.each_with_object({}) do |rspecs_by_target, hash|\n          hash[rspecs_by_target[0]] = rspecs_by_target[1].map(&:spec)\n        end\n        specs_by_source = Hash[resolver_specs_by_target.values.flatten(1).group_by(&:source).map do |source, specs|\n          [source, specs.map(&:spec).uniq]\n        end]\n        sources.each { |s| specs_by_source[s] ||= [] }\n        @result = AnalysisResult.new(podfile_state, specs_by_target, specs_by_source, specifications, sandbox_state,\n                                     aggregate_targets, pod_targets, @podfile_dependency_cache)","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/CocoaPods/CocoaPods/blob/b80e113e28a7e23cd6dbc169f0c923f6b48bf7a2/lib/cocoapods/installer/analyzer.rb#L102-L138","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run `pod install` so all listed missing dependencies are fetched into the sandbox.","If pods are missing due to a wiped/corrupt sandbox, `rm -rf Pods && pod install`.","If you call the Analyzer programmatically, pass allow_fetches: true (or :outdated only for outdated checks) instead of false.","Mark intentionally local pods with `:path =>` so they count as local and never require fetching."],"exampleFix":"# before\nanalyzer = Pod::Installer::Analyzer.new(sandbox, podfile, lockfile)\nanalyzer.analyze(false)  # raises when sandbox is missing pods\n# after\nanalyzer.analyze(true)   # allow fetching external sources\n# or simply: system('pod install')","handlingStrategy":"validation","validationCode":"# Ensure the sandbox holds every non-local dependency before analyzing\ndiff Podfile.lock Pods/Manifest.lock > /dev/null 2>&1 || pod install\n[ -d Pods ] || pod install","typeGuard":null,"tryCatchPattern":"# Programmatic: only analyze without fetches when the sandbox is provably complete\nmissing = dependencies.reject { |d| d.local? || File.directory?(File.join('Pods', d.name.split('/').first)) }\nanalyzer.analyze(missing.empty? ? false : true)","preventionTips":["When calling the Analyzer directly, default allow_fetches to true and only disable it after a successful install.","Mark vendored/development pods with `:path =>` so they never require fetching.","Run `pod install` after cloning or after deleting any Pods subdirectory."],"tags":["cocoapods","analyzer","sandbox","dependencies","fetching"],"backgroundTag":"sandbox-out-of-date","analyzedSha":"b80e113e28a7e23cd6dbc169f0c923f6b48bf7a2","analyzedAt":"2026-08-21T15:07:28.652Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}