Xcode 8.3 Archive error: Linker command failed with exit code 1 - ios

I started getting this error only after upgrading from Xcode 8.2 to Xcode 8.3, and only when making an archive build (debug builds work fine).
When I do the archive via Xcode, the only message I get is "Linker command failed with exit code 1 (use -v to see invocation).
I build with the command line xcodebuild -scheme MyProduct
When I built this way, I found a number of issues (again, only when doing Archive):
I had to add import UIKit to practically every swift file.
all the pods had issues
remove everything from app-Bridging-Header.h
add a few things back into app-Bridging-Header.h
My current issue is with the AWS pod, using version 2.5.3
So my app-Bridging-Header.h has #import <AWSS3/AWSS3.h>
Here is the error from the command line build:
error: 'AWSS3/AWSS3.h' file not found with <angled> include; use "quotes" instead
#import <AWSS3/AWSS3.h>
^
The error log continues after that. I also tried the crazy suggestion of switch in the import to "AWSS3/AWSS3.h"...that didn't work either.
What is going on?
More INFO
This really appears to be an issue with one of my pods. I built a new solution, imported a subset of my pods and everything built. Then when I updated with the full list of pods it broke.

For me it is coming due to Bitcode enable in my project and i have used a custom framework with disabled bitcode.
Two things you can do :
Either disable bitcode in your project
OR
Build framework with bitcode enable
NOTE: If you click on error and it doesn't show anything then right click on error and select Reveal in Log. You will get error for this issue

At long last I was able to figure out this was a pod issue...just had to figure out which one it was.
I created a brand new project and started adding my pods in one by one (actually, 3 by 3...one by one would have taken too long).
Conclusion: localytics 4.3.1 has a bug in it somewhere. I downgraded to 4.3.0 and the problem went away.

I got a problem like this. My suggestion is that you should remove the version of 8.3 and download any old version from this link: https://developer.apple.com/download/more/
I hope that it will work.

Related

framework not found RealmSwift

I was installing Realm and imported to my project but when I run the app it shows me an error:
ld: framework not found RealmSwift
clang: error: linker command failed with exit code 1 (use -v to see invocation)
There can be multiple reasons for this issue.
To get the exact issue you can follow the below step :
Right click on error and select 'Reveal in log'. This will give you more insight about the reason of error.
One of the solution is to setting the 'Enabled Bitcode' to No. For this go to Build settings in your target and search 'Bitcode' in the search field.
I have faced this issue multiple times and one of the below solution may work for you.
After installing the pods make sure that you're opening the workspace instead of Xcode project file.
Restart Xcode
Remove derive data for your application
Reintegrate pods using pod deintegrate and pod install for your project
Reset simulator(If you are viewing the output in simulator)
Ensure proper linking of Framework in your project
Restart simulator
Clean project etc.
Hope this may help you.
I was having the same issue.
Initially, I was trying to import the files (Realm.framework and RealmSwift.framework) from download folder but then i was getting the same error like yours.
What i did then, i copied the folder containing the (Realm.framework and RealmSwift.framework) into the project folder and then i imported the files from there. That resolves my issue.
In my case, I've updated the Cocopods to the latest version (1.1.0) via this command sudo gem install cocoapods
is it possible that you are still running the .xcodeproj file. You should run .workspace file in your xcdoe

Apple Mach -O Linker (Id) Error?

I am trying to build this xcode workspace which was built from Unity. And after modifying the project a little bit when I getting to the very end of building the project (linking) I get the Apple Mach -O Linker (Id) Error. I can't open the error tab to see what exactly is causing the error. All it says is "Linker command failed with exit code 1 (use -v to see invocation). There are also two Apple Mach -O Linker (Id) Errors which occur but I have no idea how to solve them.
Any help is greatly appreciated!
I can't expand these tabs.. this is all I get told
This is the warning tab expanded, the two Apple Mach -O Linker (Id) warnings are the same
This problem has different solutions , one of them is to set Enable Bitcode to No . ( I don't know why by default it is Yes )
This problem is a ghost like problem . Clearing Cache , Restarting Xcode , Simulator and MAC ,Ensuring proper linking of Frameworks ,Changing app Architecture or , Sometimes just doing nothing can solve this problem .
This issue was connected to "Link Binary With Libraries". I've renamed the target, and there were two .framework files for the Pods. Thus, after removing the outdated one - the issue was solved.
For me the scenario was that I removed one of the dependency in my pods which was not required, after removing it I was getting error that the same dependency not found. So I went to delete its entry from the Project >> Build Settings >> other Linker Flags and then selected the same and deleted it as shown below in the Image. After removing from the linker Flags I started getting the Apple Mach -O Linker (Id) Error? and after trying everything for a day I realised the issue lies inside the linker Flags. Where on deleting any dependecy you have to delete the other line name -framework. you can check the below image to get the clarity.
So I suggest to keep an eye on it while deleting the dependecy from the linker flags, do delete the associated -framework too which lies below the dependency name. In my case it was ObjectMapper
If you just installed/ uninstalled a pod you might want to look at this. Here's what worked for me:
First make sure you are opening the .xcworkspace file not the .xcodeproj. But this is probable not what's causing the issue.
Delete the pod that was recently just installed.
In the project directory on Xcode, open the frameworks folder and if the pod which was just removed is still listed there as one recentlyremovedpod.framework, delete it from there also. This step is what made my project compile eventually.
Another possible cause is if you rename one of your targets (why did I do that?) and you're using pods. You end up with a version of your old target name in the Frameworks folder in your main project (not the Pods project), like pods_oldtarget_framework which no longer exists.
Just delete the old version (or name your target back to it's original and delete the new one), and you should be good to go.
For me it was missing frameworks. Try searching the errors you get on Google and find out which frameworks they're part of, then import them in the Build phases tab.
I was having the same issue, and resolved by
installing the latest CocoaPods
then do pod setup
For me I had the problem because I was using Xcode 9 (beta), then I open the same project with another Xcode 8.3. To solve the problem for me just Clean then Run again.
If building on mac for ios in unity, make sure that in the build settings you disable "Metal Editor Support" under other settings for the ios platform.
I used xcode 9.3 and I got this same error. But with 9.2 it works.
The error may happen because of incompatibilities between the artifacts produced by the two xcodes. The project that threw the error included a framework built with xcode 9.2
I added libstdc++.tbd to "BuildPhases >> Link Binary With Libraries". It works for me.
How I resolved this issue:
I exit Xcode then opened my project's .xcworkspace again.
While Xcode was starting...i saw warnings...xcode is smarter enough and ask you switch to recommended settings...Tap it and let him do the changes.
(Read warning seriously and with positive mind and then you will resolve it) 😊

Xcode from Unity: "Linker command failed with exit code 1 (use -v to see invocation)"

I am getting a "Linker command failed with exit code 1 (use -v to see invocation)". As far as I understand, it is telling me that I am missing some framework.
1. I have added all the frameworks manually:
:
After cleaning and trying again, the error still persists but it complains about another framework!
2. I have also set the 'Search Path' in 'Build Settings' to recursive:
Every time I try and built it on my ipad I get the same error but complaining about a different framework despite 1&2. Has come across this?
I am working on Xcode Version 7.3.1
The error screenshot:
Directort Structure:
UPDATED Search Path:
I think that Can You check Project Target>Buil Phases>Link Binary with librarys in more than one time it is define or podfile is define multiple time some frameworks.
I was having the same issue w/ my project. I install my pods via CocoaPods, once I open up the workspace project created, I import the modules to the file. At first there will be an error, but once you Build the project, it will sweep the error. That's how I fixed my issue.
In the end, removing the all the problematic frameworks (those starting with QT) allowed me to build the app and didn't cause any noticeable issues. Its not a particularly satisfying solution, but it worked ...

Xcode Dependencies Error

I was having an issue changing my Target Deployment to 8.4 (its been 9.1since I started the project). I was getting an error saying Parse was setup to use 9.1 so I couldn't change it. Then I changed the platform information in my podfile and reinstalled the pods. Now I am getting these two errors when I try and Build the app.
Check dependencies
Unable to run command 'CpResource RLA\ Volunteer.app' - this target might include its own product.
Unable to run command 'Touch RLA\ Volunteer.app' - this target might include its
own product.
Any help is welcome.
I'm running Xcode 7.1.1 on a Macbook Pro and coding in Swift.
I figured it out. My .app file in my Product folder in Xcode had a selected target. I don't really understand why it worked by unselecting a Target Membership (so nothing is selected when I select the .app file) fixed the dependency errors.

Compiler error after adding a new Configuration in project

I encountered an issue after setting up a new value for Configuration when building (after reading the following post: Different App Icons for your iOS Beta, Dev, and Release builds). The error message is as follows:
ld: file not found:
/Users/.../Library/Developer/Xcode/DerivedData/SomeAppName-.../Build/Products/Debug-iphoneos/SomeAppName.app/SomeAppName
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
I'm not sure how to fix it, checked and double checked with the article and I did follow everything as explained.
Edit: The error appears to be from the Tests target
Managed to find the answer: https://stackoverflow.com/a/29887473/2124535
I solved it in Xcode 6 very easy like this:
Select your project in the project navigator.
Select the YourProjectTests under targets
Under General tab change the Host Application from the drop down
Build and run.
This problem happened to me because I renamed my project and the tests could't find it anymore. - Yowza7
Removing the Tests target did not help for me.
I posted a solution that did work here: Created new XCode Configuration and Scheme - linker is suddenly failing
It basically involves telling Xcode to look for the libraries created using the Release configuration.

Resources