I have a workspace containing 2 projects:
The first project has been added as a subproject reference under the second project. I have the static library building fine, it links into the app, all is well. However, I cannot seem to include the resource bundle in the app.
The bundle has been added to the app's 'Build' scheme.
I've tried dragging the Resources.bundle into the app's 'Copy Build Resources' phase, but that results in this error at build time:
.../DerivedData/MyProject-eyuldesiktlginanzifvzcfrtmgl/Build/Products/Debug-iphonesimulator/Resources.bundle: No such file or directory
So I looked at the derived data directory and I see Resources.bundle in
MyProject-eyuldesiktlginanzifvzcfrtmgl/Build/Products/Debug
not
MyProject-eyuldesiktlginanzifvzcfrtmgl/Build/Products/Debug-iphonesimulator.
I assume this is because the bundle isn't platform specific. So I tried added a build phase to copy the bundle to the Products Directory. Resulting in this build error:
.../DerivedData/MyProject-eyuldesiktlginanzifvzcfrtmgl/Build/Products/Debug-iphonesimulator/Resources.bundle depends on itself. This target might include its own product.
But there is no Debug-iphonesimulator/Resources.bundle file, so I don't see where this dependency is coming from. Any advice would be greatly appreciated.
I figured it out. The problem is (as mentioned above) that the bundle isn't platform specific so it outputs to to the Products/Debug directory while the app outputs to the Products/Debug-iphonesimulator directory. I had to add a Run Script phase to copy the resource into the app bundle:
SRC="$BUILD_DIR/$CONFIGURATION/Resources.bundle"
DEST="$BUILD_DIR/$CONFIGURATION$EFFECTIVE_PLATFORM_NAME/$FULL_PRODUCT_NAME"
cp -R "$SRC" "$DEST"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With