I have recently met the need to have a bundle inside my iPhone app. In order to make my problem as clear as possible, I have decided to create a small empty app just for the sake of the explanation.
Here is a step by step way to reproduce precisely my problem. I am using Xcode version 5.0 (5A1413).
- Open Xcode, create a new project, iOS Application, Single View Application, click Next.
- Call it InBundleTestApp. Leave the default settings the way they are and click Next.
- Choose whatever folder you want and click Create.
- Once Xcode is opened, click Add Target and choose Bundle, then click Next.
- Call it InnerBundle and leave the default settings for the rest.
- Click Finish.
- Go to the Build Phases tab of the InBundleTestApp target.
- Add InnerBundle.bundle to the "Copy Bundle Resources" list.
- Go to the Build Settings tab of the InnerBundle target.
- Change the Base SDK from Latest OS X (OS X 10.8) to Latest iOS X (iOS 7.0).
- Set InnerBundle as the active target. Compile InnerBundle by hitting Command-B.
- Set InBundleTestApp as the active target and compile it by hitting Command-B.
- Archive InBundleTestApp by choosing Product/Archive in the menu.
We get the following in the debugger:
CpResource /Users/neptune/Library/Developer/Xcode/DerivedData/InBundleTestApp-arelnznnammspkgauywlbunqsaot/Build/Intermediates/ArchiveIntermediates/InBundleTestApp/BuildProductsPath/Release-iphoneos/InnerBundle.bundle /Users/neptune/Library/Developer/Xcode/DerivedData/InBundleTestApp-arelnznnammspkgauywlbunqsaot/Build/Intermediates/ArchiveIntermediates/InBundleTestApp/InstallationBuildProductsLocation/Applications/InBundleTestApp.app/InnerBundle.bundle
cd /Users/neptune/Documents/InBundleTestApp
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -strip-debug-symbols -strip-tool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -resolve-src-symlinks /Users/neptune/Library/Developer/Xcode/DerivedData/InBundleTestApp-arelnznnammspkgauywlbunqsaot/Build/Intermediates/ArchiveIntermediates/InBundleTestApp/BuildProductsPath/Release-iphoneos/InnerBundle.bundle /Users/neptune/Library/Developer/Xcode/DerivedData/InBundleTestApp-arelnznnammspkgauywlbunqsaot/Build/Intermediates/ArchiveIntermediates/InBundleTestApp/InstallationBuildProductsLocation/Applications/InBundleTestApp.app
error: /Users/neptune/Library/Developer/Xcode/DerivedData/InBundleTestApp-arelnznnammspkgauywlbunqsaot/Build/Intermediates/ArchiveIntermediates/InBundleTestApp/BuildProductsPath/Release-iphoneos/InnerBundle.bundle: No such file or directory
Now my question is: why do we get this error? What did I do wrong in the 13 steps above?