You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

iOS应用归档报错:AFNetworking.framework文件不存在求助

Fixing "AFNetworking.framework: No such file or directory" During iOS App Archiving

Hey there, fellow iOS newbie! I’ve stumbled through this exact error when I was starting out, so let’s break down how to fix it step by step. That missing framework error usually boils down to cached build files, wonky Pod configurations, or a simple oversight that’s easy to miss as a new dev.

Step 1: Wipe Out Cached Build Data (The Nuclear Cleanup)

First, let’s get rid of all the old, possibly corrupted build files that might be causing the issue:

  • Close Xcode completely (don’t just minimize it).
  • Navigate to the DerivedData folder mentioned in your error: /Users/eenovinfogerance/Library/Developer/Xcode/DerivedData/Mercato-ascjcoguyyeglqcxxlubcypqxcdm and delete the entire folder.
  • Back in your project directory, delete the Pods folder and Podfile.lock file.
  • Open Terminal, cd to your project folder, and run pod install again. Wait for it to finish—make sure you see "Pod installation complete!" without errors.

Step 2: Double-Check You’re Using the Right Project File

This is a super common mistake for new iOS devs: always open your project using the .xcworkspace file (Mercato.xcworkspace) after using CocoaPods. If you open the old .xcodeproj file, Xcode won’t recognize the Pod frameworks like AFNetworking.

Step 3: Verify Podfile & Build Settings

Let’s make sure your Pod setup is configured correctly:

  • Open your Podfile and confirm it looks something like this (adjust the iOS version to match your project’s minimum requirement):
    platform :ios, '14.0' # Use your project's actual minimum iOS version
    use_frameworks!
    
    target 'Mercato' do
      pod 'AFNetworking'
    end
    
  • If you made changes to the Podfile, run pod update then pod install again.
  • Open your workspace, go to your project’s Build Settings, search for Framework Search Paths. Make sure it includes $(inherited) (this pulls in Pods’ framework paths automatically) and that the path isn’t red (red means the path is invalid).

Step 4: Test a Regular Build First

Before trying to archive again, do a normal build to make sure everything works:

  • Select "Generic iOS Device" (or a physical device connected to your Mac) as the build target.
  • Press Cmd + B to build the project. If this fails, fix those errors first—archiving will only work if a regular build succeeds.

Step 5: Try Archiving Again

If the regular build works, go to Product > Archive in Xcode. Make sure you’ve selected the correct Scheme (your Mercato app target) before starting the archive.

If none of these steps work, one last thing to check is your Build Phases: go to Target > Build Phases > Link Binary With Libraries and confirm AFNetworking.framework is listed. If it’s red, remove it and run pod install again to let CocoaPods re-add it.

You’ve got this—archiving issues are super common when starting out, but they’re almost always fixable with a little cleanup and configuration checks!

内容的提问来源于stack exchange,提问作者Jerome Lebont

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 07:45:47