Getting error "linker command failed with exit code 1 (use -v to see invocation)

I am trying to run my program on eclipse and getting the above error. Looks like it is an issue with the build phase in xcode. While I try to build the WebDriverAgent.xcodeproj - It is throwing the above error.

Here is the screenshot of the error I am seeing on the xcode build phase:

Environment:

Appium version : 1.6.3
OSX : 10.12
Xcode : 8.2
Ipad iOS : 9.3.1

This is the error on eclipse console:

WebDriverException: Message: u’An unknown server-side error occurred while processing the command. Original error: xcodebuild failed with code 65’

This is the appium logs :

ebs-macbook-air:~ EB_QA_AUTO$ appium
[Appium] Welcome to Appium v1.6.3 (REV 88e577b9549f724fdd459ac190079a5384d50e62)
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {“sessionId”:null,“desiredCapabilities”:{“deviceName”:“daus iPad”,“udid”:“bcaf54****************************************************”,“automationName”:“XCUITest”,“browserName”:“Safari”,“xcodeConfigFile”:"/Users/EB_QA_AUTO/node_modules/appium-xcuitest-driver/myconfig.xcconfig",“platformVersion”:“9.3”,“platformName”:“iOS”}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{“deviceName”:“daus iPad”,“udid”:“bcaf54****************************************************”,“automationName”:“XCUITest”,“browserName”:“Safari”,“xcodeConfigFile”:"/Users/EB_QA_AUTO/node_modules/appium-xcuitest-driver/myconfig.xcconfig",“platformVersion”:“9.3”,“platformName”:“iOS”},null,null,null,null]
[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium] deviceName: ‘daus iPad’
[Appium] udid: ‘bcaf54****************************************************’
[Appium] automationName: ‘XCUITest’
[Appium] browserName: ‘Safari’
[Appium] xcodeConfigFile: ‘/Users/EB_QA_AUTO/node_modules/appium-xcuitest-driver/myconfig.xcconfig’
[Appium] platformVersion: ‘9.3’
[Appium] platformName: ‘iOS’
[debug] [XCUITest] XCUITestDriver version: 2.4.2
[BaseDriver] Session created with session id: 43dbb919-bf6c-4879-be27-3b5897761767
[debug] [XCUITest] Xcode version set to ‘8.2’
[debug] [XCUITest] iOS SDK Version set to ‘10.2’
[debug] [XCUITest] Available devices: bcaf54****************************************************
[debug] [XCUITest] Creating iDevice object with udid bcaf54****************************************************
[XCUITest] Determining device to run tests on: udid: ‘bcaf54****************************************************’, real device: true
[XCUITest] Safari test requested
[debug] [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog
[debug] [iOSLog] Found idevicesyslog: ‘/usr/local/bin/idevicesyslog’
[XCUITest] Setting up real device
[XCUITest] Using WDA path: ‘/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent’
[XCUITest] Using WDA agent: ‘/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj’
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: /usr/local/bin/carthage
[debug] [XCUITest] Killing hanging processes
[debug] [XCUITest] Using real device logger ‘idevicesyslog’
[debug] [XCUITest] Using Xcode configuration file: ‘/Users/EB_QA_AUTO/node_modules/appium-xcuitest-driver/myconfig.xcconfig’
[debug] [XCUITest] Beginning test with command ‘xcodebuild build test -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=bcaf54bb6bd7b75b085a4f3dd0f2b034de0d41fa -configuration Debug -xcconfig /Users/EB_QA_AUTO/node_modules/appium-xcuitest-driver/myconfig.xcconfig’ in directory ‘/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent’
[XCUITest] Waiting for WebDriverAgent to start on device
[debug] [XCUITest] Log file for xcodebuild test: /Users/EB_QA_AUTO/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/89CD2E2F-2899-4C41-8004-837311D69760/Session-WebDriverAgentRunner-2016-12-21_103815-vHKV41.log
[Xcode] 2016-12-21 10:38:16.238 xcodebuild[4699:101823] Error Domain=IDETestOperationsObserverErrorDomain Code=3 “Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/EB_QA_AUTO/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/89CD2E2F-2899-4C41-8004-837311D69760/Session-WebDriverAgentRunner-2016-12-21_103815-vHKV41.log” UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/EB_QA_AUTO/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/89CD2E2F-2899-4C41-8004-837311D69760/Session-WebDriverAgentRunner-2016-12-21_103815-vHKV41.log}

[Xcode]
Testing failed:

[Xcode] No signing certificate “iOS Development” found: No “iOS Development” signing certificate matching team ID “<6P7**************>” with a private key was found.
** TEST FAILED **

The following build commands failed:
Check dependencies
(1 failure)

[XCUITest] xcodebuild exited with code ‘65’ and signal ‘null’
[debug] [XCUITest] xcodebuild failure warrants retry. Retrying…
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down Logger process (pid 4700)
[XCUITest] System log exited with code ‘0’
[debug] [XCUITest] Removing WDA application from device
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: /usr/local/bin/carthage
[debug] [XCUITest] Killing hanging processes
[debug] [XCUITest] Using real device logger ‘idevicesyslog’
[debug] [XCUITest] Using Xcode configuration file: ‘/Users/EB_QA_AUTO/node_modules/appium-xcuitest-driver/myconfig.xcconfig’
[debug] [XCUITest] Beginning test with command ‘xcodebuild build test -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=bcaf54bb6bd7b75b085a4f3dd0f2b034de0d41fa -configuration Debug -xcconfig /Users/EB_QA_AUTO/node_modules/appium-xcuitest-driver/myconfig.xcconfig’ in directory ‘/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent’
[XCUITest] Waiting for WebDriverAgent to start on device
[debug] [XCUITest] Log file for xcodebuild test: /Users/EB_QA_AUTO/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/18C85F44-E85A-4FE5-9D5F-3A0C8EA13DD1/Session-WebDriverAgentRunner-2016-12-21_103820-OPYLS5.log
[Xcode] 2016-12-21 10:38:21.782 xcodebuild[4737:101926] Error Domain=IDETestOperationsObserverErrorDomain Code=3 “Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/EB_QA_AUTO/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/18C85F44-E85A-4FE5-9D5F-3A0C8EA13DD1/Session-WebDriverAgentRunner-2016-12-21_103820-OPYLS5.log” UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/EB_QA_AUTO/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/18C85F44-E85A-4FE5-9D5F-3A0C8EA13DD1/Session-WebDriverAgentRunner-2016-12-21_103820-OPYLS5.log}

[Xcode]
Testing failed:

[Xcode] No signing certificate “iOS Development” found: No “iOS Development” signing certificate matching team ID “<6P7**************>” with a private key was found.
** TEST FAILED **

The following build commands failed:
Check dependencies
(1 failure)

[XCUITest] xcodebuild exited with code ‘65’ and signal ‘null’
[XCUITest] Error: xcodebuild failed with code 65
at SubProcess. (…/…/lib/webdriveragent.js:355:25)
at emitTwo (events.js:106:13)
at SubProcess.emit (events.js:191:7)
at ChildProcess. (…/…/lib/teen_process.js:197:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
Error: xcodebuild failed with code 65
at SubProcess. (…/…/lib/webdriveragent.js:355:25)
at emitTwo (events.js:106:13)
at SubProcess.emit (events.js:191:7)
at ChildProcess. (…/…/lib/teen_process.js:197:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down Logger process (pid 4738)
[XCUITest] System log exited with code ‘0’
[debug] [XCUITest] Running ios real device reset flow
[debug] [XCUITest] Resetting simulator
[debug] [iOSLog] Stopping iOS log capture
[MJSONWP] Encountered internal error running command: Error: xcodebuild failed with code 65
at SubProcess. (…/…/lib/webdriveragent.js:355:25)
at emitTwo (events.js:106:13)
at SubProcess.emit (events.js:191:7)
at ChildProcess. (…/…/lib/teen_process.js:197:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
[HTTP] <-- POST /wd/hub/session 500 10758 ms - 167

Note: I have masked the udid & the team id here in the logs.

Please help…!!
@Cauthon @vani.hosagoudra @pavanbachu @crujzo

Thank you.

Hey please follow these steps Xcodebuild failed with code 65 (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 32.63 seconds

Hi @pavanbachu, I tried to install carthage using your instructions:

cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/
$ npm install -g carthage --HEAD
$ open

But, getting the following error on the Terminal :

Can you please guide me on this?

First : try with sudo, if not then,
Second: just install carthage in your from your root folder it will install it in the default location : which will be usr/local/Cellar and that should work

Please let us know if it doesn’t work.

It’s brew install carthage

Hi,

@pavanbachu : I tried brew install carthage in the WebDriverAgent location as shown below in the screenshot - din’t work, got the following error :

@crujzo : I tried sudo npm install -g carthage --HEAD but got this following error again :

Next, I tried brew install carthage from the root folder and got the below output for this :

I see a carthage folder here in this location /usr/local/Cellar.

Even after performing all these - I am still facing the same issue. Please help…!! And also please let me know if I was wrong somewhere in your above guidelines. @pavanbachu @crujzo

@jtangadagi I believe the location is : /usr/local/lib/node_modules/appium-xcuitest-driver/WebDriverAgent

@jtangadagi Did you try executing after installing carthage ?
Did you install ios-deploy (if not brew install ios-deploy)

@crujzo : But, I have the WebdriverAgent located in the following location : /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent

If I try the location what you have specified, I dont find the WebDriverAgent here.
Location specified by you : /usr/local/lib/node_modules/appium-xcuitest-driver/WebDriverAgent

So, to give an overview about the locations of the WebDriverAgent,
Your’s : /usr/local/lib/node_modules/appium-xcuitest-driver/WebDriverAgent
Mine : /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent

This is the difference. Can you please help me from here?

Hi @pavanbachu, Yes I tried the install iso-deploy using npm install -g iso-deploy and got installed successfully on the Terminal.

Please uninstall the Appium from your MAC and retry these steps

Capabilities:

		capabilities.setCapability("automationName", "XCUITest");
		capabilities.setCapability("platformVersion", "10.1");
	    capabilities.setCapability("xcodeConfigFile",“/path/to/Configfile.xcconfig");

Installation:
Ios-deploy: brew install ios-deploy
Carthage: brew install carthage

Install Appium : npm install -g appium

Dependencies:
cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/
/bin/bash Scripts/bootstrap.sh -d

Change the Xcode Version to XCODE 8 : sudo xcode-select --switch /path/to/Xcode.app/ (incase you have more than one xcode installed)`

Hi @pavanbachu, I now uninstalled appium 1.6.3 from my MAC. Should I follow your above steps first and then install appium 1.6.3 again or first re-install appium 1.6.3 and perform the above steps?

Please guide me.

Hi @pavanbachu, I tried to follow your steps and made an attempt to uninstall & re-install appium a/c to your steps, I now again see a different build failure in Xcode. I have attached the screenshot below for your reference.

Can you please guide me on how to fix this issue?

Can you please download the dependencies before pushing the Webdriver Agent
app

Are you referring to these dependencies specified by you?

Dependencies: cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent//bin/bash Scripts/bootstrap.sh -d

I had done this before and it looked like this

Please let me know if this is right.!!