Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 corner of the navigator and then confirming that I want the checked items' names changed, I get the following error when I try running it: "clang: error: linker command failed with exit code 1 (use -v to see invocation)"

I've even tried using the find tool to see all the things named the previous name, including the info.plist (which I think is the problem) and changing them to the new name. By renaming the info.plist manually I get an error saying that doesn't exist.

What am I doing wrong?

like image 398
blue Avatar asked Oct 04 '14 21:10

blue


3 Answers

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)

like image 95
ccwasden Avatar answered Nov 03 '22 02:11

ccwasden


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.

like image 6
Stéphane Bruckert Avatar answered Nov 03 '22 02:11

Stéphane Bruckert


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.

like image 5
Norly Canarias Avatar answered Nov 03 '22 01:11

Norly Canarias