Error after renaming Xcode 6 project: “linker command failed with exit code 1 (use -v to see invocation)”

后端 未结 8 1006
情深已故
情深已故 2020-12-12 11:54

So after I create an Xcode 6 project, even if I haven\'t written any code in it, if I try renaming it by double clicking the bolded program title in the upper left hand corn

相关标签:
8条回答
  • 2020-12-12 12:36

    There are many places you have to check upon re-naming. This approach does not seem at all practical.

    If you really need to do this, I recommend creating a new project and just copying the necessary files over to the new project.

    0 讨论(0)
  • 2020-12-12 12:39

    I saw the same error after changing the name, and I was able to fix it by clearing the "Test Host" values in the Build Settings of my "Tests" target:

    enter image description here

    Alternatively, If you need your tests to be able to run after changing the name of your project, you should be able to update the MyProject.app/MyProject value in both fields to reflect the new name of your project (ie. MyNewProject.app/MyNewProject)

    0 讨论(0)
  • 2020-12-12 12:39

    If above method(s) doesn't work and if for now you don't feel like needing to test anything in your project, just remove your project test target.

    Later on if you need to create some tests, you will still be able to add test targets again.

    0 讨论(0)
  • Go to the Build Settings of my "Tests" target then change the paths from the old project name to your new project name

    Test Host
     - Debug   Build/Debug-iphoneos/OldProjectName.app/OldProjectName
     - Release Build/Release-iphoneos/OldProjectName.app/OldProjectName
    
    Test Host
     - Debug   Build/Debug-iphoneos/NewProjectName.app/NewProjectName
     - Release Build/Release-iphoneos/NewProjectName.app/NewProjectName
    

    Just simply clearing them would break your tests so you need to replace them with the new project name.

    0 讨论(0)
  • 2020-12-12 12:42

    Here is what I've done to fix the similar problem since I changed the project name and folders under the project.

    1. Select project file : projectName.xcodeproj
    2. Right click on the project file and click "Show package contents" to open project.pbxproj file.
    3. Once ope project.pbxproj file, replace all from old project name (whatever you changed from) to new name.
    4. You can change the name of sub folder if you changed folder name too.

    Hope this help.

    0 讨论(0)
  • 2020-12-12 12:47

    If you doesn't use the test target you can delete this target.

    0 讨论(0)
提交回复
热议问题