241

I've just upgraded to xcode 4.0 and I can no longer deploy to iPhone, I get a Apple Mach-O Linker Error, it still works for the simulator though.

    Ld /Users/yveswheeler/Library/Developer/Xcode/DerivedData/iParcel-fkeqjcjcbbhjwhdssjptkdxzzzxh/Build/Intermediates/iParcel.build/Debug-iphoneos/iParcel.build/Objects-normal/armv7/iParcel normal armv7
    cd /Users/yveswheeler/iParcel
    setenv IPHONEOS_DEPLOYMENT_TARGET 3.2
    setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2 -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk -L/Users/yveswheeler/Library/Developer/Xcode/DerivedData/iParcel-fkeqjcjcbbhjwhdssjptkdxzzzxh/Build/Products/Debug-iphoneos -F/Users/yveswheeler/Library/Developer/Xcode/DerivedData/iParcel-fkeqjcjcbbhjwhdssjptkdxzzzxh/Build/Products/Debug-iphoneos -filelist /Users/yveswheeler/Library/Developer/Xcode/DerivedData/iParcel-fkeqjcjcbbhjwhdssjptkdxzzzxh/Build/Intermediates/iParcel.build/Debug-iphoneos/iParcel.build/Objects-normal/armv7/iParcel.LinkFileList -dead_strip -all_load -ObjC -lxml2 -miphoneos-version-min=3.2 -framework UIKit -framework CoreGraphics -framework QuartzCore /Users/yveswheeler/Library/Developer/Xcode/DerivedData/iParcel-fkeqjcjcbbhjwhdssjptkdxzzzxh/Build/Products/Debug-iphoneos/libThree20.a /Users/yveswheeler/Library/Developer/Xcode/DerivedData/iParcel-fkeqjcjcbbhjwhdssjptkdxzzzxh/Build/Products/Debug-iphoneos/libThree20Core.a /Users/yveswheeler/Library/Developer/Xcode/DerivedData/iParcel-fkeqjcjcbbhjwhdssjptkdxzzzxh/Build/Products/Debug-iphoneos/libThree20Network.a /Users/yveswheeler/Library/Developer/Xcode/DerivedData/iParcel-fkeqjcjcbbhjwhdssjptkdxzzzxh/Build/Products/Debug-iphoneos/libThree20Style.a /Users/yveswheeler/Library/Developer/Xcode/DerivedData/iParcel-fkeqjcjcbbhjwhdssjptkdxzzzxh/Build/Products/Debug-iphoneos/libThree20UI.a /Users/yveswheeler/Library/Developer/Xcode/DerivedData/iParcel-fkeqjcjcbbhjwhdssjptkdxzzzxh/Build/Products/Debug-iphoneos/libThree20UICommon.a /Users/yveswheeler/Library/Developer/Xcode/DerivedData/iParcel-fkeqjcjcbbhjwhdssjptkdxzzzxh/Build/Products/Debug-iphoneos/libThree20UINavigator.a -framework AddressBook -lz.1.2.3 -framework Foundation -framework CFNetwork -framework MobileCoreServices -framework SystemConfiguration -framework MessageUI -framework AudioToolbox -o /Users/yveswheeler/Library/Developer/Xcode/DerivedData/iParcel-fkeqjcjcbbhjwhdssjptkdxzzzxh/Build/Intermediates/iParcel.build/Debug-iphoneos/iParcel.build/Objects-normal/armv7/iParcel

arm-apple-darwin10-g++-4.2.1: /Users/yveswheeler/Library/Developer/Xcode/DerivedData/iParcel-fkeqjcjcbbhjwhdssjptkdxzzzxh/Build/Products/Debug-iphoneos/libThree20.a: No such file or directory
arm-apple-darwin10-g++-4.2.1: /Users/yveswheeler/Library/Developer/Xcode/DerivedData/iParcel-fkeqjcjcbbhjwhdssjptkdxzzzxh/Build/Products/Debug-iphoneos/libThree20Core.a: No such file or directory
arm-apple-darwin10-g++-4.2.1: /Users/yveswheeler/Library/Developer/Xcode/DerivedData/iParcel-fkeqjcjcbbhjwhdssjptkdxzzzxh/Build/Products/Debug-iphoneos/libThree20Network.a: No such file or directory
arm-apple-darwin10-g++-4.2.1: /Users/yveswheeler/Library/Developer/Xcode/DerivedData/iParcel-fkeqjcjcbbhjwhdssjptkdxzzzxh/Build/Products/Debug-iphoneos/libThree20Style.a: No such file or directory
arm-apple-darwin10-g++-4.2.1: /Users/yveswheeler/Library/Developer/Xcode/DerivedData/iParcel-fkeqjcjcbbhjwhdssjptkdxzzzxh/Build/Products/Debug-iphoneos/libThree20UI.a: No such file or directory
arm-apple-darwin10-g++-4.2.1: /Users/yveswheeler/Library/Developer/Xcode/DerivedData/iParcel-fkeqjcjcbbhjwhdssjptkdxzzzxh/Build/Products/Debug-iphoneos/libThree20UICommon.a: No such file or directory
arm-apple-darwin10-g++-4.2.1: /Users/yveswheeler/Library/Developer/Xcode/DerivedData/iParcel-fkeqjcjcbbhjwhdssjptkdxzzzxh/Build/Products/Debug-iphoneos/libThree20UINavigator.a: No such file or directory
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2 failed with exit code 1
Lukesivi
  • 2,206
  • 4
  • 25
  • 43
CodeVomit
  • 749
  • 2
  • 7
  • 10

69 Answers69

214

Here is permanent solution.Generally overwriting project may cause this prolems.Try this method.

-UPDATE - Clang error - Mach-O Linker error

In some case error log window displaying .xctest error, to fix it

-> Select your project

-> Beside this(just before General tab) select your projectTest file from dropdown

-> There is one option (like ProjNameTests)

-> In Host Application, select your project from dropdown only if it show custom

DONE!

enter image description here

Old method deleted

Gajendra K Chauhan
  • 3,387
  • 7
  • 40
  • 55
194

I had the same problem and the issue was that I have accidently imported a .m file instead of .h in an implementation file.

starball
  • 20,030
  • 7
  • 43
  • 238
Daniel
  • 935
  • 2
  • 6
  • 11
  • 1
    Impossible to find error! Just try each and every solution – AsifHabib Dec 17 '14 at 14:23
  • This is not true, I've tried the same thing in a new project and still getting same error. – Hemang Jun 11 '15 at 12:26
  • Go to the Project settings and Build phases section, make sure you do not have a .m file in the section "Copy Bundle Resources" instead of the "Compile Sources". that worked for me – LuAndre Sep 27 '16 at 20:03
  • Impossible to find the solution. I do not know what I am going to do... – Markus Oct 25 '16 at 13:50
72

Just ran into the same issue.

The solution (for me) = check your frameworks.

In my case I had added classes related to CoreData without "CoreData.framework". Adding it solved the MACH_O complaining.

Dante Cesa
  • 330
  • 2
  • 4
  • 6
    It happens also when you linked again a library that isn't present in the latest SDK release. Let's say you linked against libz.1.2.3 and the sdk includes 1.2.5. Check your frameworks is a really good suggestion! Thank you Dante! – SlowTree Jan 05 '12 at 10:39
  • Thanks SlowTree, save suggestion solved my experience with this linker crash. libz.1.2.3 to libz.1.2.5; – Tom Pace Jan 13 '12 at 04:20
  • 3
    Cocoapods linked two `libPods.a` files for me (hence the duplicate symbols). Thanks, Dante! – Nick Merrill Dec 20 '14 at 19:21
  • Yes. Removed .a files and added again from linker. Its worked! – Balasubramanian Jun 13 '17 at 14:03
62

open .xcworkspace file not .xcodeproj. I repeat open .xcworkspace file. All of your errors will go away.

mahi
  • 532
  • 10
  • 16
36

Re: Problem as outlined in title:

Just in case anyone else missed the obvious...

I came across this error after installing a new version of Xcode4 and dragging existing files into a new project. I had failed to spot that the 'add to targets' checkbox was left unchecked in the 'Choose options for adding files:' dialog. Correcting my omission in Targets>Build Phases>Compile Sources solved the problem.

cate
  • 600
  • 7
  • 15
34

Menu > Product > Clean, this is what made it work. I'm not sure about everyone else. I added pic to show.

enter image description here

dnaatwork.com
  • 362
  • 5
  • 9
29

Bizarre error. For me, I just cleaned and restarted Xcode and the problem went away.

p.pad
  • 529
  • 7
  • 11
26

Fix: Build Settings > Enable Bitcode > No enter image description here

Sebastián Lara
  • 5,355
  • 2
  • 28
  • 21
23

None of these answers helped me. Then I tried to reinstall Cocoapods:

pod deintegrate

pod install

Problem solved!

Johannes
  • 1,370
  • 16
  • 15
  • I'm not sure where the disconnect with pods & xcode is but often times it's a struggle to make sure pods files make it to the derivedData folder. This seems to fix that issue. I wish I could start just this answer.. – Jacksonkr Sep 19 '17 at 13:54
20

The problem was that in XCode 4, the dependencies do not assume the architecture settings of the main project, as they previously did in XCode 3. I had to go through all of my dependencies setting them for the correct architecture.

CodeVomit
  • 749
  • 2
  • 7
  • 10
  • 2
    thank you! I was completed misled by the fact that the error message from the linker complains about "File not Found", not "File found, but I can't use it ...", and was wandering through the xcode settings looking for library search paths. But this worked for me. And if you hare having this problem, this other post is also related: http://stackoverflow.com/questions/2999844/three20-and-ios-4. Also, this nice summary blog: http://www.amirnaor.com/?p=112 – Rob Aug 28 '11 at 13:48
13

I had the same and managed to solve it.

In xcode preferences, location tab change value under build location to "Place build products in locations specified by targets".

Wolfert
  • 974
  • 6
  • 12
  • Thanks Wolfert, tried that but still have 1250 Apple Mach-O Linker Warnings and no progress. Did you do anything else to fix this? Cheers –  Mar 22 '11 at 22:14
  • 6
    Option isn't available in XCode 5.1 – Hemang Nov 04 '14 at 10:02
13

I struggled with this for a little while, and in my case it ended up being the Build Setting under Search Paths called FRAMEWORK_SEARCH_PATHS. It helped that I selected the "Levels" button, which seemed to compare my project, target and "Resolved" settings. I saw that my target setting somehow overrode the default of "$(inherited)", and the overridden value was what XCode "resolved" the setting to be. When I removed the override, which in this case specified the 3.2 sdk, the linker errors went away -- as did some recently appeared warnings about any classes where I called post-4.0 methods.

About those warnings -- I never saw them before I added the MessageUI framework for a recent change. I suspect, but don't know for sure, that when I added that framework, XCode tried to do something clever by adding that override to my target. I didn't do it explicitly at any point. The warnings were,for example, about the URLByAppendingPathComponent method of NSURL, which did not appear until sdk 4.0. Prior to adding the MessageUI framework, I never got that warning. And since I removed the override, I no longer get them.

tigerswim19
  • 81
  • 1
  • 2
11

I had this issue and importing QuartzCore fixed it.

jmosesman
  • 716
  • 1
  • 11
  • 24
8

Changing "Build Active Architectures Only" to Yes in CordovaLib.xcodeproj -> Build Settings did the trick for me. earlier the app was running on simulator, but not on the device.

Nishanth Nair
  • 2,975
  • 2
  • 19
  • 22
7

You may need to update your build settings.

Verify the iOS target version and the processor architectures, as you may not have the old SDKs with XCode 4.

You may see «Missing SDK» on the build settings. Change that to whatever applies.

Macmade
  • 52,708
  • 13
  • 106
  • 123
7

I had the same issue: just accidentally deleted a .m file, while .h was in the project. The problem disappeared when I've restored the .m file.

Misha Karpenko
  • 2,168
  • 17
  • 18
6

Check to make sure that you don't have a specific framework search path specified. if you go to the info on the target and just remove the framework search path entries it should use the defaults for your specified deployment version.

Grady Player
  • 14,399
  • 2
  • 48
  • 76
5

I had exactly the same problem just because I had two same constants in different classes. You also can have this problem if you import .m file not .h file

Adela Toderici
  • 1,118
  • 13
  • 30
5

I just try to create a category class file and got this weird issue..and finally....

Wrong way to create category class that causes the issue:

New File -> Cocoa Touch -> Objective-C class, then I modified the name of files to Category Class like name.. (i.e. OriginalClass_CategoryName.h/m to OriginalClass+CategoryName.h/m, and also modified the contents in the file).

Right way here:

New File -> Cocoa Touch -> Objective-C category, and it'll auto generate files (OriginalClass+CategoryName.h/m).

Oh, how stupid I am!!

Community
  • 1
  • 1
Kjuly
  • 34,476
  • 22
  • 104
  • 118
5

If you are using CoreData, and you use XCode to generate NSManagedObject subclasses for your entities, make sure you only generate one for each entity.

My problem was that it generated multiple NSManagedObject subclasses for the same entity (and put them in different folders).

I just deleted all of them and regenerated the NSManagedObject subclasses.

Flaviu
  • 6,240
  • 4
  • 35
  • 33
5

To add onto the list of weird stuff that fixed this issue...

I had some const CGFloat variables in a global header file like so

const NSInteger  globalInteger1 = 2;
const NSInteger  globalInteger2 = 3;

The moment I removed these, all was fine :)

sherlock
  • 1,521
  • 2
  • 13
  • 17
  • 1
    My WEIRD issue was at the .pch or constants.h file I have declared a constant as NSString * const kInitiaNotification = @"kInitialNotification"; without mentioning the "static" at first – Mazen Kasser Feb 12 '14 at 06:23
  • I had the issue just after I changed from `NSString static *key = @"someKey"` to `const NSString *key = @"someKey"` – TonyTony Sep 09 '14 at 15:42
4

I solved this problem too weird !

Go to Target > Build Phases > Link Binary with libraries :

Remove all your frameworks and add them again !

Hope it works for you !

Rudi
  • 4,304
  • 4
  • 34
  • 44
4

For Swift language ...

I am getting this error " ld: file too small (length=0) .... "

In my case I just clean the project and then rebuild it ..

Steps:-

1) goto Project -> Clean

2) goto Project -> Build

Hope this helps..

Niks
  • 87
  • 2
  • 8
4

This did a trick for me:

Go to

1) Products > clean

2) Windows > Projects

3) Select your project and click on "Delete" derived Data

4) Products > Build

4

Not sure if it's related, but seeing that you're running some three20 libraries, you may want to check this post on their website: http://three20.info/article/2011-03-10-Xcode4-Support

Rog
  • 18,602
  • 6
  • 76
  • 97
4

I had the same problem, and I solved it. In my case, "architectures" setting caused the problem. In my project file, Build Settings tab, Architectures were set to armv6. I changed it to Standard(armv7), do clean and build. Then it worked!

Kim Jin
  • 31
  • 3
4

In my case the problem was having different architectures specified under different targets. I was building my application target with armv6, armv7 and cocos2d with Standard (amrv7). Go into build settings and make sure your architectures agree for all targets.

ChrisP
  • 5,812
  • 1
  • 33
  • 36
3

I was able to fix this error by editing "Library Search Paths"

It cropped up in the first place because I had moved a couple folders around, and that ended up giving my build settings two different search paths because they are are automatically added to your build settings when you link a library/framework, but they are not always removed.

So if you move a linked library/framework to a different directory and re-link it, you'll have to manually edit the search path.

You might be able to dodge this by removing the library/framework before moving it, but I haven't tested that.

Rembrandt Q. Einstein
  • 1,101
  • 10
  • 23
3

For me it was accidentally importing an implementation ".m" file instead of the corresponding header ".h" file. As soon as I caught that the project build was back to normal.

owenfi
  • 2,471
  • 1
  • 24
  • 37
3

Code Signinig!!!

I had this issue too - "linker command failed with exit code 1 (use -v to see invocation)"

my problem was I tried to run the app on a real device, and I forgot to configure the Code Signing section in the Build Settings tab.

Aviram Netanel
  • 12,633
  • 9
  • 45
  • 69
3

for me the problem was I had loaded same functions twice. Remove -ObjC from Build Settings > Linking > Other Linker Flags.

Agu Dondo
  • 12,638
  • 7
  • 57
  • 68
3

If you have defined NSObject with the same name like:

NSObject *notUniqueObj;

even in 2 different files ( if you are importing one in another ), it will give you an error. Give different names for those.

Omkar Jadhav
  • 1,046
  • 3
  • 16
  • 41
3

One possibility: Turn on "Dead code stripping" in the Xcode 4 build settings.

Another possibility: It could be that you switched to using LLVM for some framework that was previously using GCC. Moving back to GCC (or LLVM GCC) may get rid of those warnings.

Enchilada
  • 3,859
  • 1
  • 36
  • 69
3

I mistakenly defined a new constant with the same name as an existing constant in a different file and it caused this error for me using xCode 4.3.1. xCode didn't complain but the compiler doesn't like it.

moliveira
  • 798
  • 8
  • 17
2

For me was architectures fault when running on device in XCode 4.5.x.

XCode 4.5 doesn't support armv6 any more, so my fix was:

I just edited all targets in all libraries (three20Core, three20Common, etc.) and libThree20: in build settings have chosen only armv7 and armv7s in "Architectures" and "Valid Architectures"

Paulius Vindzigelskis
  • 2,121
  • 6
  • 29
  • 41
2

In my case I had duplicated a class file! Found it by using the bottom search field at the right side bar of Xcode, so to solve it remove reference of one of them

Mazen Kasser
  • 3,559
  • 2
  • 25
  • 35
2

My fix for my same problem: Adding the "other linker flags" in "Project" and not in "Targets". So, I moved it to "Targets", it shouldn't be in "Project".

Idan Moshe
  • 1,675
  • 4
  • 28
  • 65
2

I was accidentally trying to compile for 64-bit simulator which was not agreeing with my CocoaPods

Alan
  • 4,325
  • 3
  • 21
  • 25
2

I'm running xcode 5. In my case I've to change my "Deployment Target". It was previously set as 3.0 and I change it to 7.0. Now the error message gone. To change your "Deployment Target", follow the steps:

  • Go to your "Project name" (top left)
  • Go to your "Targets" (middle of the screen)
  • Go to "General"
  • "Deployment Info"
  • "Deployment Target"

Change it to current iOS version. -Thanks.

Tulon
  • 4,011
  • 6
  • 36
  • 56
1

If you're getting a Mach-O Linker warning or error that says "Directory not found for option", lookup the path of that directory. If it's missing try downloading the latest version of RestKit and putting the folder in manually.

Kyle Clegg
  • 38,547
  • 26
  • 130
  • 141
1

I accidentally added two copies of the same subclass of a UITableViewController. Removing one of the sets of files cleared up the error.

SmileBot
  • 19,393
  • 7
  • 65
  • 62
1

My issue was because I didn't defined variables as extern in one of my header files and it was redeclared in the .c file.

Dan
  • 1,812
  • 3
  • 13
  • 27
1

The solution of this problem is very simple Just go to the directory where the project installed and open the file with extension ".xcworkspace"

That will solve the problem .

Ahmed Samir
  • 291
  • 3
  • 6
0

I fixed it by changing Mach-O Type under linking section on the Build settings from Nothing to Executable.

j0k
  • 22,600
  • 28
  • 79
  • 90
Menan Vadivel
  • 106
  • 1
  • 5
0

I got this problem after importing a framework. Under 'Build Phases', the framework's name was highlighted in red. I added the framework again and the problem was solved.

yoeriboven
  • 3,541
  • 3
  • 25
  • 40
0

Follow these steps to fix this problem:

Go to project settings and Build Tab. Search for "Other Linker Flags"

Double click on the linker flags for Release and Change:

 ${TARGET_BUILD_DIR}/libCordova.a to ${BUILT_PRODUCTS_DIR}/libCordova.a

Do the same for Debug Clean and build archive again.

Unheilig
  • 16,196
  • 193
  • 68
  • 98
0

I got the same issue when i export FMDB module in xcode 4.6. Later i found a fmdb.m in my my file list which was causing this issue. After i removed from the project it works fine

winari
  • 46
  • 4
0

in my case i just moved the .h .m file from one folder to other folder and that folder was not exsisting behind. so i created folder first on finder and then moved the file on finder and then add that folder and remove the reference of moved filed to other folder from project it stopped giving me error

0

I had this same problem just a minute ago. which lead me here, which wasn't of any help. But I figured out what was the problem and fixed it. the problem was that in my header file i had declare one instance of the struct class named trig_node[SIZE]

my header...

struct TrigNode
{
    float msin;
    float mcos;
    float mtan;
}trig_node[SIZE];

and in my .cpp file i have a function that access this instance and return the answer.

float cos_table_(float deg)
{
    uint n = ((SIZE/DEGRE)*deg);
    return trig_node[n % DEGRE].mcos;
}

which is what as causing my linking error. So, to fix that i place the instance of the trig table class "trig_node[SIZE]" in the .cpp file which cleared the error. so now the new fix looked something like this

my header...

struct TrigNode
{
    float msin;
    float mcos;
    float mtan;
};

my .cpp file trig_node[SIZE]

float cos_table_(float deg)
{
    uint n = ((SIZE/DEGRE)*deg);
    return trig_node[n % DEGRE].mcos;
}
kanthonye
  • 149
  • 1
  • 4
0

This error can also be occurred if you have imported two different versions of same library ,in this case just remove the older version and keep only one version and Magic will work for you.

AHSAN NAZIR RAJA
  • 166
  • 1
  • 13
0

If you used XCode to create a custom NSManagedObject class and then add to it and generate a new file for the custom class, sometimes XCode will not overwrite your old class and you will be stuck with two of the same files but in different directories. Find the old file and delete it.

The problem could be something else though.

0

Could you try Unity-Build Settings-Player Settings-SDK Version: Device SDK instead of simulator sdk

Ive had such error and that fixed it

Stormy
  • 541
  • 4
  • 9
0

I encountered with this problem to figure out that I have two references in my XCODE project. Just delete the other reference. Hope this helps

Rick Royd Aban
  • 904
  • 6
  • 33
0

I had the same Problem, As I was dragging some files .h and .m into my Project and Xcode started showing me this error clang: error: linker command failed with exit code 1 (use -v to see invocation) while running.

Later I discovered that I already have that .h & .m in my Xcode Project under some other SubFolder. So I deleted that Extra .h and .m , Cleaned my Project and Its working now.

clang: error: linker command failed with exit code 1 (use -v to see invocation) This error comes for a number of reason, Thats why this Question has so many Answers. You just need to see & check; what case you fall in.

Jasmeet
  • 1,522
  • 2
  • 22
  • 41
0

i think the best response is to look into files imports , some imports has a problem .

example : include #import "file.m" or include external file.h

...

user2165491
  • 101
  • 1
  • 4
0

My specific error was:

ld: entry point (_main) undefined. for architecture armv7

Which should have been obvious, but it's because main.m was not include into Compile Sources under Build Phases

Jacksonkr
  • 31,583
  • 39
  • 180
  • 284
0

I would like to share one more reason when I got this error:

I had changed the project name in Project Navigator(in Xcode 6.1.1) by single click on it and my project would not compile. I changed the project name back to old name, project was building. Very very strange but yes I have faced this. I hope this information helps.

skypirate
  • 663
  • 1
  • 7
  • 13
0

I simply had to files with a main() method and Xcode wasn't happy about that.

Curlip
  • 395
  • 1
  • 3
  • 15
0

If you use Xcode 7 or later just do a product -> clean. This worked for me.

Daniel
  • 3,758
  • 3
  • 22
  • 43
0

My problem was that in multiple class.m files I had created an NSString named TAG, and I had set the value of TAG to the String name of each class (Ex: NSString * TAG = HWGuiControl). I had done so that then it was easy to prepend my NSLog statements with the name of the class. (I have used this system in Android with great success, great for analyzing program flow 2 years later). Deploying to a device, this all works great. But when its time to create an Archive for distribution, apparently the linker cannot contend with the NSString named TAG appearing in multiple files. Modifying the name(s) of TAG to HWGTAG, etc, did the trick.

0

In my own case, I had duplicate declarations of some keys. I declared some NSString Constants using the extern keyword and did exactly the same thing in two different class files. When I removed one of them, the error disappeared.

extern NSString *const CFDataStatusKey;
extern NSString *const CFDataErrorKey;
extern NSString *const CFDataReasonKey;
extern NSString *const CFDataChannelsKey;

These where declared and initialized respectively in .h and .m files of the two classes. Removing a duplicate solved the issue. Hopes this helps

0

In my case, the cause of such Apple Mach-O Linker error was source code file (.m) inclusion to resource bundle target.

Verify that recently created .m file is not included in a bundle: select the file in project navigator, open file inspector and make sure that resource bundle checkbox is deselected in Target Membership section.

pjuzeliunas
  • 1,596
  • 1
  • 15
  • 19
0

I had to make sure my framework was built with a Simulator selected in order to build my project with a simulator (my project of course is using the framework). Same goes for building on my iPhone everything has to be in sync not sure why but it fixes the issue.

I hope this helps someone.

jer_francis
  • 153
  • 1
  • 11
0

In my case i has include .m file thats why compiler shows this type of error.

you should check the latest file import that is not .m file " Sometime i"

0

Please go to your workspace setting and make the following changes:

Workspace Setting:
   Build System:
     Legacy BuilPer-User


 Per-User Workspace
  DerivedData:
    Workspace relative location



Build System 
    Use User Setting
NickCoder
  • 1,504
  • 2
  • 23
  • 35
Andy Rubin
  • 25
  • 7
0

For our Flutter project, we recently changed the bundle identifier and it doesn't get updated properly in Info.plist. Thus, creating this issue.

We had to add/update following keys in Info.plist with given values:

  • BUNDLE_ID
  • CFBundleDisplayName
  • CFBundleName
  • <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    
  • <key>CFBundlePackageType</key>
    <string>APPL</string>
    
  • <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleExecutable</key>
    <string>${EXECUTABLE_NAME}</string>
    
  • <key>CFBundleShortVersionString</key>
    <string>$(MARKETING_VERSION)</string>
    <key>CFBundleVersion</key>
    <string>$(CURRENT_PROJECT_VERSION)</string>
    

Also, please make sure that your project.pbxproj file also contain the following with static values:

MARKETING_VERSION = 1.0;
CURRENT_PROJECT_VERSION = 1;

If any of these info is not correctly linked then it will keep showing this error.

Chintan Shah
  • 1,744
  • 2
  • 26
  • 28
-1

Try to clean your project, and Compile.

Tom John
  • 99
  • 1
  • 7
-1

With CocoaPod, first install and then open the workspace instead of project as specified on CocoaPod website.

$ pod install

$ open YOUR_PROJECT_NAME.xcworkspace
Hassan Rahman
  • 4,953
  • 1
  • 34
  • 32
-2

In my case

I just removed armv7s and armv64 and build its works.

Hardik Mamtora
  • 1,642
  • 17
  • 23