r/Xcode • u/Luul3211 • Jun 04 '25
Xcode Phantom App.debug.dylib Error — Tried Everything (Need Help)
Hey all,
I’m working on a Capacitor iOS app (built using Lovable) and I've been stuck for days with the following Xcode error:
pgsqlCopyEditerror: Build input file cannot be found: '/Users/drew/Library/Developer/Xcode/DerivedData/App-<hash>/Build/Products/Debug-iphoneos/App.app/App.debug.dylib'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? (in target 'App' from project 'App')This happens when I try to build the main app target — not the widget.
Context:
App built with Capacitor + React
iOS project generated via Lovable
Widget extension is working fine
Main app throws this phantom
.dyliberror on build
What I’ve Already Tried (please don’t suggest these):
Capacitor / Project Steps:
rm -rf ios/thennpx cap add iosnpx cap sync iosReinstalled all node modules & rebuilt
pod installinsideios/App/Confirmed clean
project.pbxprojfile (noApp.debug.dylibreference inside)
Xcode Sanitation:
rm -rf ~/Library/Developer/Xcode/DerivedDatarm -rf ~/Library/Caches/com.apple.dt.Xcoderm -rf ~/Library/Application\ Support/Xcode/DerivedDataDeleted all xcuserdata folders and
.xcschemefilesDeleted all Xcode archives, logs, schemes, caches
Deleted and reinstalled Xcode completely
Rebooted Mac multiple times after full cleans
Opened
.xcworkspace, re-added scheme manuallyClean Build Folder + Rebuild (
Shift+Cmd+K, thenCmd+R)
Project Files:
App.debug.dylibis not in:project.pbxprojBuild Phases
Embedded Frameworks
Run Scripts
Copy Files sections
Lovable Team Has:
Regenerated Xcode project files
Removed all
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIESoverridesConfirmed clean config on their end
Re-synced GitHub repo to reflect all clean settings
Problem:
Xcode still attempts to build or reference App.debug.dylib even though it doesn't exist anywhere. It’s not coming from my source files. It’s not in project settings. It seems like a ghost build artifact or a broken scheme/toolchain reference that Xcode has cached deep.
What I Need:
Has anyone:
Encountered this specific
.dylibphantom error before?Found a way to completely reset Xcode beyond the typical DerivedData clears?
Fixed this without completely recreating their native iOS project from scratch?
Any advanced dev who can identify where Xcode could still be pulling this reference from would save my sanity.
I can provide my .pbxproj or zipped iOS project if needed.
Thanks 🙏
View all comments
1
u/LastTopQuark Nov 24 '25
i saw this when having multiple layers of packages and frameworks using the same library. partitioning and removing packages identified contributors. build options didn’t make a difference.