SwiftyJSON.framework显示禁用,运行项目提示文件不存在求助
Fixing Disabled SwiftyJSON.framework & "No Such File or Directory" Error
Hey there, let's get this SwiftyJSON issue sorted out—this kind of framework linking glitch is super common, and we can work through it step by step:
First, do a full CocoaPods reset & clean
Sometimes partial reinstalls leave behind corrupted configs. Here's what to do:- Close Xcode completely
- Open your project folder, run these commands in Terminal:
pod deintegrate rm Podfile.lock rm -rf Pods - Clean Xcode's derived data: Either use
Cmd+Shift+Kin Xcode (after reopening it briefly), or manually delete the folder at~/Library/Developer/Xcode/DerivedData(find the folder named after your project).
Reinstall Pods & use the correct project file
- Run
pod installin your project folder - Make sure you open the
.xcworkspacefile, not.xcodeproj—this is the #1 mistake that causes Pod framework issues! - Once in Xcode, go to your target's
Build Phases > Link Binary With Libraries. If SwiftyJSON is still disabled:- Remove it from the list
- Click the
+button, selectAdd Other..., then navigate toPods/SwiftyJSON/SwiftyJSON.frameworkand add it back
- Run
Verify Build Settings are set correctly
- Go to your target's
Build Settingstab - Search for
Framework Search Paths—ensure it includes$(inherited)and${PODS_ROOT}/SwiftyJSON, set torecursive - Search for
Other Linker Flags—make sure$(inherited)is present here (this pulls in all Pods' required linker settings)
- Go to your target's
Check architecture compatibility
A mismatch in supported architectures can mark frameworks as disabled:- In
Build Settings, search forArchitectures - Set
ArchitecturestoStandard Architectures (arm64, x86_64) - Set
Build Active Architecture OnlytoYesfor Debug,Nofor Release
- In
Last resort: Restart Xcode (and your computer!)
Xcode loves to hold onto cached weirdness. A full restart often fixes those "why is this happening?!" bugs that don't make sense on paper.
内容的提问来源于stack exchange,提问作者j.lo
相关产品推荐
相关产品推荐

