This is because the compiler is trying to run the script within the embedded framework before actually embedding the framework itself. Reorder the default build phases to fix this:
Clean the build folder.
[Press option button and Product -> Clean]
Under 'Build Phases', Move the 'Embed Frameworks' section to above the 'Run Script' phase.
Clean the build folder.
[Press option button and Product -> Clean]
Under 'Build Phases', Move the 'Embed Frameworks' section to above the 'Run Script' phase.

