Linker Command failed with exit code 1 (use -v to see invocation)? - xcode8

while Running i face this issue.
Linker Command failed with exit code 1 (use -v to see invocation)? in xcode 8.3.2.
I am not using COCOAPODS in my project
while clicking issue navigator item.For this particular error its not opening.
Error Screen shot
https://i.stack.imgur.com/usJFW.png

Possible solutions.
Go to Compile sources in Build Phases, make sure there is no
duplicate files and all .m files of your project is there.
Go to your build settings and switch the target's settings to
ENABLE_BITCODE = YES.
Try luck with Product -> Clean

Related

xcodebuild: error: 'project.pbxproj' is not a project file

I am new to Xcode so I am probably doing something wrong (or missing something in this case). I would appreciate any help.
I've just created a new project on Xcode. New Project -> macOS -> Command Prompt. I've saved it somewhere and as soon as Xcode returns with its main screen on my project's properties, I've closed it. Then cd'd to the folder where my .xcodeproject was (on terminal) and ran xcodebuild install and it returns me that message. Additionally, I tried editing my project Schema from debug to release and closed Xcode again (to make sure everything was saved), same error.
If I build the project from Xcode's UI it works, obviously, it will print Hello World, but I can't run the builder from command line. Does anyone have any tips? Thank you!
This is on Xcode 8.3.3.
I ran into this issue and my fix was due to an overlooked flag in my .gitlab-ci.yml file.
Pretty easy fix :)
So the error says:
xcodebuild: error: '<some file>' is not a project file.
The reason for that was because in my .gitlab-ci.yml file it said -project instead of -workspace
Super easy to overlook. So if you have the: is not a project file error, make sure your flag says -workspace and not -project.
Alternatively if you have the opposite error xcodebuild: error: '<some file>' is not a workspace file then you'll want to change your -workspace flag to -project
My bad... the xcodebuild install command works from one directory up, outside the .xcodeproj folder.

Apple Mach-O Linker Error IOS

When i tried to build and run my project im getting this error.I tried may steps like clean and run, check with workspace.project but still im getting the error.No further details were in the error message. "Linker command failed with exit code 1(use -v to see invocation)
There can be many reasons for this problem, sadly with such little knowledge of your project I can only suggest some fixes
Check for any caution messages and try to fix them
This can also be caused by using #import to import an .m file, if you are using this then remove it.
Sometimes this can be caused by frameworks and libraries, If you are using an external or custom framework, you probably need to add it to the "Frameworks" folder inside the application.
Hope this helped but if it didn't I might need some more info on your project.
Go to Project file -> Build Phases and check if there ara any red icons (specially for Compile Sources or Copy Bundle Resources)

Linker command failed with exit code 1 - duplicate symbol __TMRbBp

Since I've updated to Xcode 8.1 I can't archive and also not run in Release mode (in debug mode its working). The error is that there are several "duplicate symbols for architecture arm64" and all are "duplicate symbol __TMRbBp". Whats that?
It seems to be a bug in Swift. See
discussion on Apple developers portal
It is said to be fixed in Xcode version that is about to be released.
But for now there is temporary workaround:
Go to your target Build Settings and set Reflection Metadata Level flag to None
Don't double click Project.xcodeproj to start your xcode project. Instead, close your project and open the xcworkspace.
File -> Close Workspace
File -> Open -> Search your project folder for Project.xcworkspace
All my errors are gone.
I faced the same problem with archiving on Xcode 8.1.
X Code Version: Version 8.2.1 (8C1002)
The following fix worked on Mar 2019
1) Go to Project & Select your Project
2) Select Build Settings -
Search for "Enable Bitcode" Set option as "NO"
3) Most of version will fix this issue, for few other XCode version try this option also,
Search for "Reflection Metadata Level" Set option as "NONE"
I had similar issues with Version 9.2 (9C40b), the solution is
0) Close Xcode
1) Open project folder in terminal
2) pod update
3) open .
4) open project by clicking Project.xcworkspace
Surprisingly, in some occasions, simply cleaning the product worked for me.
Product/Clean (Shift+Cmd+K)
Product/Clean Build Folder (Alt+Shift+Cmd+K)
Quick fix to try before looking at other solutions.
1.Close your project:Completely quit Xcode.
2.Go to your project location:there you will find two files in you root folder with varying extensions:
Appname.xcodeproj and Appname.xcworkspace
Now open your project by Double clicking on file with the extensions xcworkspace.(***Appname.xcworkspace*)**
Yourproject will open in xcode.
Now run your project again.
If you pay close attention when installing your pods,firebase makes it clear to open your project with your-project.xcworkspace after installing pods
firebaseIOS Setup
$ cd your-project directory
$ pod init
Add to Podfile
pod 'Firebase/Core'
And finally:
$ pod install
$ open your-project.xcworkspace
Dont forget to add firebase to your AppDelegate
If you're using Ionic and the Push and Console plugins that's the problem. Remove the cordova console plugin (which is deprecated) and the error will disappear.
The linker error is saying that a library is duplicated which is, in fact, true because the console plugin is already in cordova-ios 4.5+
It took me a couple of hours to figure this out!
In my case
Select your project (In my case i have 2 targets)
Go to Build Phases
Compile Sources
Check if the number of items on each targets is the same (mine was different)
Add the missing file / Remove the duplicated file
Problem Solved
I ran into this problem recently creating a new project and adding some pods (AlamoFire specifically) to the project. Troubled with it a couple hours or so recreating the project (it was new) several times. Tried all the methods here and no luck.
Eventually I figured out that it was because XCode V10.1 was also opening the old project file along with the new pod-created workspace when I opened the workspace via command line "open myProject.xcworkspace" when I reopened the project after doing "pod install"
Closing all projects before exiting XCode before I did my "pod install" fixed everything for me.
close you project then open xcode go to file -> open search your project and open it . this worked for me
I got this error due to deletion of some files. For me simply cloning my project worked.
For those that can't get the Thorax's answer to work, what I did was I closed out Xcode, ran pod update on my command line and then reopened the .xcworkspace file. After doing that, I was able to build and run the project.
I am using the Firebase Cocoapod and Xcode version 9.1.
I had removed files from Compile Sources in Build Phases in Targets. I added main.m and it worked.
Had the same problem in Xcode 10.1 and was able to resolve it. In path Project Target > Build Setting > No Common Blocks, I changed it to No.
I had similar kind of problem when I added a framework to my project.
I have resolved the issue by removing the framework and again adding the framework to the project by dragging and dropping the framework file to the projects frameworks folder and selecting the Copy items if needed option.

How to solve linker command failed with exit code 1 (use -v to see invocation)

i am getting this error when i am performing archive for my app.
linker command failed with exit code 1 (use -v to see invocation)
can any one help me to solve this.
Thanks
So many different problems for the same error message.
1) if you had two same constants in different classes then also this issue happens.
2) if you have accidently imported a .m file instead of .h file in an implementation file.
3) 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.
4) Adding the "other linker flags" in "Project" and not in "Targets". So, you move it to "Targets", it shouldn't be in "Project".
5) Check it out in project->target->build settings-> search enable bitcode->set NO in DEBUG
check out this .. if it's OK then once do like following.
Menu > Product > Clean ... then Run the project
Hope it helps you.. :)

Apple Mach-O framework error

I'm trying to install the DevMate framework. I've followed every step on DevMates website, and i cant compile my app. I've added it into the link binary with libraries tab, and the copy files build phase tab. Everything is where it should be but I'm still getting this error:
ld: warning: directory not found for option '-F/Users/Saturn/Documents/Floating Lunch Box/Xcode/StatScreen/Users/Saturn/Documents/Floating Lunch Box/Xcode/StatScreen/StatScreen/DevMateKit/DevMateKit.framework/Frameworks'
ld: file not found: #rpath/DevMateIssuesReporter.framework/Versions/A/DevMateIssuesReporter for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation) Linker command failed with exit code 1 (use iv to see invocation)`
I'm sorry if this is some stupid fix but I'm new to programming and I just want to implement this framework without having so much trouble. Thanks for any help!
Xcode 6.4
Cocoa Apphttp://docs.devmate.com/v1.0/docs/integrate-devmate-kit
This was bugging me a lot lately. DevMakeKit contains a nested DevMateIssuesReporter framework and Xcode cannot find it without its path specified in FRAMEWORK_SEARCH_PATHS, that's kind of what Dmytro says.
But you can also tell Xcode to perform recursive search inside the specified framework path, by selecting recursive option in the popover dialogue.
The gotcha is to ensure EXCLUDED_RECURSIVE_SEARCH_PATH_SUBDIRECTORIES doesn't contain *.framework entry, otherwise Xcode ignores DevMateKit.framework/Frameworks. It seems you can do the same using INCLUDED_RECURSIVE_SEARCH_PATH_SUBDIRECTORIES, but I didn't have much success with that.
The problem described here is that linker could not find directory /Users/Saturn/Documents/Floating Lunch Box/Xcode/StatScreen/Users/Saturn/Documents/Floating Lunch Box/Xcode/StatScreen/StatScreen/DevMateKit/DevMateKit.framework/Frameworks where DevMateIssuesReporter.frameworks should be.
Are you sure this is the correct path to DevMateKit.framework? I think it should be /Users/Saturn/Documents/Floating Lunch Box/Xcode/StatScreen/StatScreen/DevMateKit/DevMateKit.framework/Frameworks. Try to correct it. You can also use Examples project at GitHub.