Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add Copy Pods Resources back?

I accidentally deleted "Copy Pods Resources", how can I add it back? I have tried 'pod install' and it doesn't work I have only one target in the project

like image 831
Kiddo Avatar asked Apr 01 '14 17:04

Kiddo


2 Answers

i found you need to edit project.pbxproj

to include those lines:

E0F2945D18DC83D9006CC8FE is your target ID

in /* Begin PBXNativeTarget section */

update build phases:

buildPhases = (
            E0F2928A18DC83D9006CC8FE /* Check Pods Manifest.lock */,
            E0F2928A18DC83D9006CC8FE /* Sources */,
            E0F2930018DC83D9006CC8FE /* Frameworks */,
            E0F2932118DC83D9006CC8FE /* Resources */,
            E0F2945D18DC83D9006CC8FE /* ShellScript */,
            E0F2945E18DC83D9006CC8FE /* CopyFiles */,
            E0F2945E18DC83D9006CC8FE /* Copy Pods Resources */,
            );

then

/* Begin PBXShellScriptBuildPhase section */
        E0F2945D18DC83D9006CC8FE /* ShellScript */ = {
            isa = PBXShellScriptBuildPhase;
            buildActionMask = 2147483647;
            files = (
            );
            inputPaths = (
            );
            outputPaths = (
            );
            runOnlyForDeploymentPostprocessing = 0;
            shellPath = /bin/sh;
            shellScript = "";
        };
        E0F2945D18DC83D9006CC8FE /* Copy Pods Resources */ = {
            isa = PBXShellScriptBuildPhase;
            buildActionMask = 2147483647;
            files = (
            );
            inputPaths = (
            );
            name = "Copy Pods Resources";
            outputPaths = (
            );
            runOnlyForDeploymentPostprocessing = 0;
            shellPath = /bin/sh;
            shellScript = "\"${SRCROOT}/Pods/Pods-resources.sh\"\n";
            showEnvVarsInLog = 0;
        };
        E0F2945D18DC83D9006CC8FE /* Check Pods Manifest.lock */ = {
            isa = PBXShellScriptBuildPhase;
            buildActionMask = 2147483647;
            files = (
            );
            inputPaths = (
            );
            name = "Check Pods Manifest.lock";
            outputPaths = (
            );
            runOnlyForDeploymentPostprocessing = 0;
            shellPath = /bin/sh;
            shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n    cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n    exit 1\nfi\n";
            showEnvVarsInLog = 0;
        };
/* End PBXShellScriptBuildPhase section */
like image 74
Kiddo Avatar answered Sep 25 '22 10:09

Kiddo


This has happened to me before. I've found that by removing all traces of Cocoapods from your project/folders and then doing a pod install, it puts back all the build phases etc.

My steps:

  • Delete the workspace
  • Delete the Pods folder
  • Delete the Podfile.lock file
  • From Build Phases tab, for the target you are working on, remove the 'Check Pods Manifest.lock' build phase (it will be the only Cocoapods build phase left since the resources step is gone to begin with)
  • Under Build Settings tab, for the target you are working on, remove any Cocoapods paths etc, if you want to be safe. When starting out with Cocoapods and not yet fully understanding it all, I also performed this step to make sure I start with a clean slate.
like image 29
Wilmar Avatar answered Sep 23 '22 10:09

Wilmar