Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: No such file or directory while archiving iOS and WatchOS App

i have a problem which puzzles me a few days now and i cannot find a solution. What i want to do is archiving an iOS app including a watchOS app in Xcode.

The normal debug build (of both iOS App and WatchOS App) works fine on real devices and simulators (note: CocoaPods included). But when i try to archive the project the following error occurs:

error: /Users/username/Library/Developer/Xcode/DerivedData/Build/Intermediates/ArchiveIntermediates/AppName/BuildProductsPath/Release-watchos/AppNameWatch.app: No such file or directory

I tried to clean up everything, delete the DerivedData folder, restart Xcode, delete the App from the devices, restart the Mac... but nothing solves the problem. I also tried to archive without CocoaPods integration (I removed CocoaPods from my Project completely). I also played around with the target build phases (removing the embedded watch content).

Maybe somebody has an idea...

Thanks

Steffen

like image 258
Steffen Ruppel Avatar asked May 25 '16 23:05

Steffen Ruppel


1 Answers

I managed to solve this error, marked as PBCXCp Error, by correcting my Target Dependencies from Project->Build Phases. Here is how the Target Dependencies should look:

iOS app target

enter image description here

Watch app target

enter image description here

Watch extension target

enter image description here

I've accidentally added my iOS app as a target dependency to my watch extension target and that generated the error.

Hope it helps, cheers.

like image 196
victor.vasilica Avatar answered Nov 19 '22 11:11

victor.vasilica