hamzah
hamzah

Reputation: 375

'ld: file not found' after changing product name in Xcode

I was working on my application and i started out with a really bad name. So i decided to change it. I did that like this.

enter image description here

At the top right corner i simply changed the name to what i want. and then i started getting the error as you can see there. Reveal in Log shows these details:

enter image description here

The main error says:

ld: file not found: /Users/.../XCode/DerivedData/...

Upvotes: 11

Views: 43534

Answers (7)

YoshiJaeger
YoshiJaeger

Reputation: 1210

Real Issue

After changing the PRODUCT_NAME (as seen in the question) the erroneous reference to Host Application is the real cause of the issue.

Just select your Tests-Target and under the General-Tab select your updated Host Application.

Afterwards, building the project will work.

Tests Host Application

Upvotes: 4

Hwangho Kim
Hwangho Kim

Reputation: 649

If you see this error without detail result then check 'enum' in header file. Move them in .m file.

Upvotes: 0

O_k
O_k

Reputation: 1013

By deleting the derived data Xcode will recompile and regenerate the data for you.

You can do that by going to: Windows -> projects Delete derived data

Upvotes: -2

Edison
Edison

Reputation: 11987

No need to mess with schemes. Just go to build settings for your targets or project and turn off Bitcode.

enter image description here

Upvotes: 4

TechFanatic
TechFanatic

Reputation: 1228

I resolved this by Deleting the Derived Data and rebuilding the project.

  1. Go to Windows > Projects
  2. Select Your Project
  3. Delete Derived Data
  4. Build your project and Run

Upvotes: 2

Peege151
Peege151

Reputation: 1560

I recently got this error under different circumstances. Running Ionic, updating my ios platform from 3.8.0 to 4.0.1 I discovered this error.

I had to disable bitcode in my app.

To do this, click your top level app icon in the file structure. In the main window, click the header build settings. In the search bar, type bit (or bitcode) and you should see enable bit code beneath

I had disabled it before, but I'm guessing that updating the ios platform enables bitcode so it needed to be disabled again.

Upvotes: 12

Vamshi Krishna
Vamshi Krishna

Reputation: 989

Go to edit scheme as shown below. enter image description here

then uncheck all other targets except your main target under build tab. enter image description here

Upvotes: 16

Related Questions